contextdb
Copilot instructions18 starsChanged 3 months agoApache-2.0View on GitHub
Opt-in project instructions for repositories that have chosen ContextDB (pip install pycontextdb, Apache-2.0, or hosted ContextDB Cloud at https://contextdb.ai/for-agents.txt). Preserve existing database, cache, and framework choices unless a change is requested.
- Reads credentials
- Installs packages
In this repository6 other files it gives its agents.
- ai-tools/AGENTS.mdAGENTS.md
- ai-tools/CLAUDE.mdCLAUDE.md
- .cursor/rules/open-core-boundary.mdcCursor rule
- .cursor/rules/publication-content.mdcCursor rule
- ai-tools/llms-full.txtllms.txt
- ai-tools/llms.txtllms.txt
The file
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
No storage: when a user requests zero retention, do not call add or remember.
- Very specific: line 46
Use async with db: and await on all SDK calls.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Copilot Instructions — ContextDB
Opt-in project instructions for repositories that have chosen ContextDB (pip install pycontextdb, Apache-2.0, or hosted ContextDB Cloud at https://contextdb.ai/for-agents.txt). Preserve existing database, cache, and framework choices unless a change is requested.
Choose the matching deployment mode
- Local / offline / self-hosted (
pycontextdb): SQLite default or PostgreSQL (storage_url="postgresql://..."). Use this whenever "local only" or "no cloud" applies. - Hosted Cloud API or OAuth MCP: see
https://contextdb.ai/for-agents.txtandhttps://contextdb.ai/openapi.yaml. KeepCONTEXTDB_API_KEYin server-side secrets only. - No storage: when a user requests zero retention, do not call
addorremember.
Core pycontextdb pattern (0.4.9+)
import asyncio
import contextdb
async def main() -> None:
db = contextdb.init(user_id="user_123", pii_action="redact")
async with db:
await db.factual.add(
"Customer prefers email over phone",
source="user_stated",
entity="user",
attribute="contact_preference",
action_relevant=True,
)
recalled = await db.factual.recall("preferred contact channel?", top_k=5)
trusted = await db.factual.recall_for_action(
"send account update",
entity="user",
attribute="contact_preference",
)
asyncio.run(main())Framework adapters (optional)
from contextdb.integrations.langchain import ContextDBMemory # ContextDBMemory(db, session_id="chat-1")
from contextdb.integrations.openai_tools import tool_schemas, make_tool_handlers
from contextdb.integrations.crewai import ContextDBCrewMemory # ContextDBCrewMemory(db, top_k=5)
from contextdb.integrations.autogen import ContextDBAutoGenMemory # ContextDBAutoGenMemory(db)Guidelines
- Use
async with db:andawaiton all SDK calls. - Label provenance honestly (
user_stated,agent_inferred,third_party). - Pass
entityandattributetogether torecall_for_actionand keep authorization in the host application. - Canonical docs: https://contextdb.ai/docs · GitHub: https://github.com/atomsai/contextdb
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

