Memory bank for system C++ library #1374

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

Originally created by @segoon on GitHub (Aug 19, 2025).

Originally assigned to: @thdxr on GitHub.

I maintain a C++ library that is installed in /usr/include. How can I write memory bank (AGENT.md, etc.) for it to be able to automatically include library's memory bank file(s)?

Originally created by @segoon on GitHub (Aug 19, 2025). Originally assigned to: @thdxr on GitHub. I maintain a C++ library that is installed in /usr/include. How can I write memory bank (AGENT.md, etc.) for it to be able to automatically include library's memory bank file(s)?
yindo closed this issue 2026-02-16 17:30:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 19, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1986: Discusses Agent-OS integration with AGENT.md files for library memory banks
  • #1306: Covers proper usage of AGENT.md files and custom agents for library integration

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 19, 2025): This issue might be a duplicate of existing issues. Please check: - #1986: Discusses Agent-OS integration with AGENT.md files for library memory banks - #1306: Covers proper usage of AGENT.md files and custom agents for library integration Feel free to ignore if none of these address your specific case.
Author
Owner

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

@segoon this sounds like a job for the instructions parameter in your global opencode config: https://opencode.ai/docs/rules/#custom-instructions

to make it say you have a memory bank file at ~/memory.md

you can just add that to “instructions” and it will be injected into prompt automatically

@rekram1-node commented on GitHub (Aug 19, 2025): @segoon this sounds like a job for the instructions parameter in your global opencode config: https://opencode.ai/docs/rules/#custom-instructions to make it say you have a memory bank file at ~/memory.md you can just add that to “instructions” and it will be injected into prompt automatically
Author
Owner

@segoon commented on GitHub (Aug 19, 2025):

I want to install the memory bank with my library system-wide. The problem is where to put it.

I understand I can put it in my $HOME and point the config to it, but I want to set it in the library package to be sure all library users will profit from the library's memory bank.

@segoon commented on GitHub (Aug 19, 2025): I want to install the memory bank with my library system-wide. The problem is where to put it. I understand I can put it in my $HOME and point the config to it, but I want to set it in the library package to be sure all library users will profit from the library's memory bank.
Author
Owner

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

Ah in that case I would recommend putting your memory in the global AGENTS.md file then?

@rekram1-node commented on GitHub (Aug 19, 2025): Ah in that case I would recommend putting your memory in the global AGENTS.md file then?
Author
Owner

@segoon commented on GitHub (Aug 19, 2025):

What is it "global AGENTS.md"? Where should it be located, in what directory? Is there any standard for that?

@segoon commented on GitHub (Aug 19, 2025): What is it "global AGENTS.md"? Where should it be located, in what directory? Is there any standard for that?
Author
Owner

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

@segoon here are our docs for AGENTS.md

Relevant section:

Global
You can also have global rules in a ~/.config/opencode/AGENTS.md file. This gets applied across all opencode sessions.

Since this isn’t committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.

@rekram1-node commented on GitHub (Aug 19, 2025): @segoon [here](https://opencode.ai/docs/rules/#global) are our docs for AGENTS.md Relevant section: > [Global](https://opencode.ai/docs/rules/#global) > You can also have global rules in a ~/.config/opencode/AGENTS.md file. This gets applied across all opencode sessions. > Since this isn’t committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.
Author
Owner

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

does this answer your question?

@rekram1-node commented on GitHub (Aug 19, 2025): does this answer your question?
Author
Owner

@segoon commented on GitHub (Aug 19, 2025):

It's user-specific, not system-wide.

@segoon commented on GitHub (Aug 19, 2025): It's user-specific, not system-wide.
Author
Owner

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

so you are talking about users on your machine not like users of the library in general?

@rekram1-node commented on GitHub (Aug 19, 2025): so you are talking about users on your machine not like users of the library in general?
Author
Owner

@segoon commented on GitHub (Aug 22, 2025):

My library consists of the files:

/usr/include/library.h
/usr/lib/liblibrary.a

I want to add AGENT.md into the package itself system-wide. E.g. into somewhere like /usr/share/library/AGENT.md, but the way that's opencode can autodiscover AGENT.md file without any configuration.

@segoon commented on GitHub (Aug 22, 2025): My library consists of the files: ``` /usr/include/library.h /usr/lib/liblibrary.a ``` I want to add `AGENT.md` into the package itself system-wide. E.g. into somewhere like `/usr/share/library/AGENT.md`, but the way that's opencode can autodiscover AGENT.md file without any configuration.
Author
Owner

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

ah i see

@rekram1-node commented on GitHub (Aug 23, 2025): ah i see
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1374