Is there a repository map or RAG feature? #1397

Closed
opened 2026-02-16 17:30:48 -05:00 by yindo · 10 comments
Owner

Originally created by @vldF on GitHub (Aug 20, 2025).

Originally assigned to: @thdxr on GitHub.

Repository map (Aider, continue) allows LLM automatically understand high-level structure of a codebase to be able to query some detailed info about it if needed

RAGs are also allows to optimize LLM work. Tool indexes the whole codebase with embedding LLM, then on user request it appends the most similar files to the context

As far as I can see there are no these features right now. Do you have plans to support them?

Originally created by @vldF on GitHub (Aug 20, 2025). Originally assigned to: @thdxr on GitHub. Repository map (Aider, continue) allows LLM automatically understand high-level structure of a codebase to be able to query some detailed info about it if needed RAGs are also allows to optimize LLM work. Tool indexes the whole codebase with embedding LLM, then on user request it appends the most similar files to the context As far as I can see there are no these features right now. Do you have plans to support them?
yindo closed this issue 2026-02-16 17:30:48 -05:00
Author
Owner

@rekram1-node commented on GitHub (Aug 20, 2025):

@vldF we do inject information about environment to llm like your project tree, example (this is excerpt from opencode repo):

.github/
	workflows/
		deploy.yml
		duplicate-issues.yml
		guidelines-check.yml
		notify-discord.yml
		opencode.yml
		publish-github-action.yml
		publish-vscode.yml
		publish.yml
		stats.yml
		typecheck.yml
cloud/
	app/
		public/
			favicon.ico

^^ this is injected into system prompt

@rekram1-node commented on GitHub (Aug 20, 2025): @vldF we do inject information about environment to llm like your project tree, example (this is excerpt from opencode repo): ``` .github/ workflows/ deploy.yml duplicate-issues.yml guidelines-check.yml notify-discord.yml opencode.yml publish-github-action.yml publish-vscode.yml publish.yml stats.yml typecheck.yml cloud/ app/ public/ favicon.ico ``` ^^ this is injected into system prompt
Author
Owner

@vldF commented on GitHub (Aug 20, 2025):

@rekram1-node what if my codebase is a large monorepository and I'd like to send only part of it? Also, the files list doesn't provide any info about files content (repository map provides it, for example; RAG too)

@vldF commented on GitHub (Aug 20, 2025): @rekram1-node what if my codebase is a large monorepository and I'd like to send only part of it? Also, the files list doesn't provide any info about files content (repository map provides it, for example; RAG too)
Author
Owner

@rekram1-node commented on GitHub (Aug 20, 2025):

what if my codebase is a large monorepository and I'd like to send only part of it

We only list up to 200 files

Also, the files list doesn't provide any info about files content

correct

@rekram1-node commented on GitHub (Aug 20, 2025): > what if my codebase is a large monorepository and I'd like to send only part of it We only list up to 200 files > Also, the files list doesn't provide any info about files content correct
Author
Owner

@justindonnaruma commented on GitHub (Aug 20, 2025):

@vldF - I was wondering about this as well. I think I could build this functionality outside of core as a plugin/tool, and then we could update the global Agents.md file to make sure it uses the RAG before reaching out to the internet, or using other tools.

@justindonnaruma commented on GitHub (Aug 20, 2025): @vldF - I was wondering about this as well. I think I could build this functionality outside of core as a plugin/tool, and then we could update the global Agents.md file to make sure it uses the RAG before reaching out to the internet, or using other tools.
Author
Owner

@Volko61 commented on GitHub (Aug 30, 2025):

According to https://www.youtube.com/watch?v=m0X_hmLBhwo
It might be very relevent to use AST

@Volko61 commented on GitHub (Aug 30, 2025): According to https://www.youtube.com/watch?v=m0X_hmLBhwo It might be very relevent to use AST
Author
Owner

@taqtiqa-mark commented on GitHub (Oct 14, 2025):

@vldF - I was wondering about this as well.

You might like to add your feedback on the /add command being discussed here:
#1990

@vldF is #1990 sufficiently on-point for you to close this issue and track developments there?

@taqtiqa-mark commented on GitHub (Oct 14, 2025): > [@vldF](https://github.com/vldF) - I was wondering about this as well. You might like to add your feedback on the `/add` command being discussed here: #1990 @vldF is #1990 sufficiently on-point for you to close this issue and track developments there?
Author
Owner

@taqtiqa-mark commented on GitHub (Oct 14, 2025):

^^ this is injected into system prompt

@rekram1-node, I am pretty sure this is an abuse of the system prompt esspecially in non-trivial workflows (see #3112) where the context will change as the workflow progresses.

But perhaps there is a better issue to track that discussion?

@taqtiqa-mark commented on GitHub (Oct 14, 2025): > ^^ this is injected into system prompt @rekram1-node, I am pretty sure this is an abuse of the system prompt esspecially in non-trivial workflows (see #3112) where the context will change as the workflow progresses. But perhaps there is a better issue to track that discussion?
Author
Owner

@rekram1-node commented on GitHub (Oct 14, 2025):

it is pretty standard in coding agents to include information about the current project, can you outline why it is an abuse? I could see argument for user prompt usage tho

@rekram1-node commented on GitHub (Oct 14, 2025): it is pretty standard in coding agents to include information about the current project, can you outline why it is an abuse? I could see argument for user prompt usage tho
Author
Owner

@taqtiqa-mark commented on GitHub (Oct 14, 2025):

it is pretty standard in coding agents to include information about the current project

Agreed, the question is which prompt does the information belong.
From the LLM view this is: System-Prompt (one-off), or User-Prompt (multiple)?

Ack. this can be Vendor dependent: X.ai has collections, but I don't believe the node ai package supports this yet?

In the node ai abstractions this is: System-Message vs User-Message vs Assistant-Message.

Using the abstractions OC introduces this is, IIUC: Mode-Prompt (current behavior?), Agent-Prompt-Text or Context-Text

can you outline why it is an abuse?

Generally, "The system prompt to use that specifies the behavior of the model." A list of files does not specify the behavior of the model.

See my earlier doc suggestions

Only in very narrow use cases will the relevant files be unchanging across the session:

... esspecially in non-trivial workflows (see https://github.com/sst/opencode/issues/3112)

When /add lands the system prompt should only include such data if the user configures it, default could be system_prompt_files: true, but in general users will employ /add ... at the start of a CLI session, or in more complex workflows the agent/subgents will /add ...; /drop ... as the workflow progresses.

@taqtiqa-mark commented on GitHub (Oct 14, 2025): > it is pretty standard in coding agents to include information about the current project Agreed, the question is which prompt does the information belong. From the LLM view this is: System-Prompt (one-off), or User-Prompt (multiple)? Ack. this can be Vendor dependent: X.ai has collections, but I don't believe the node `ai` package supports this yet? In the node `ai` abstractions this is: System-Message vs User-Message vs Assistant-Message. Using the abstractions OC introduces this is, IIUC: Mode-Prompt (current behavior?), Agent-Prompt-Text or Context-Text > can you outline why it is an abuse? Generally, ["The system prompt to use that specifies the behavior of the model."](https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-object#system) A list of files does not specify the behavior of the model. See [my earlier doc suggestions](https://github.com/sst/opencode/issues/1990#issuecomment-3399894873) Only in very narrow use cases will the relevant files be unchanging across the session: > ... esspecially in non-trivial workflows (see https://github.com/sst/opencode/issues/3112) When `/add` lands the system prompt should only include such data if the user configures it, default could be `system_prompt_files: true`, but in general users will employ `/add ...` at the start of a CLI session, or in more complex workflows the agent/subgents will `/add ...; /drop ...` as the workflow progresses.
Author
Owner

@vldF commented on GitHub (Oct 16, 2025):

Yeah, let's move to another discussion

@vldF commented on GitHub (Oct 16, 2025): Yeah, let's move to another discussion
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1397