contextdb / ai-tools
llms.txt18 starsChanged 3 months agoApache-2.0View on GitHub
Apache-2.0 Python memory engine for AI agents (pip install pycontextdb) with epistemic provenance (user_stated / agent_inferred / third_party), PII redaction and encryption before embedding, temporal slot validity (event_time / as_of), hybrid BM25 + vector + graph retrieval (RRF), and slot-scoped pre-action verification (recall_for_action + confirm). Runs offline on SQLite or self-hosted on PostgreSQL/pgvector.
- Reads credentials
- Installs packages
In this repository6 other files it gives its agents.
- ai-tools/AGENTS.mdAGENTS.md
- ai-tools/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/open-core-boundary.mdcCursor rule
- .cursor/rules/publication-content.mdcCursor rule
- ai-tools/llms-full.txtllms.txt
The file
We split this llms.txt into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Local / offline / self-hosted (
pycontextdb): Use when you want an embedded SQLite or self-hosted PostgreSQL engine in Python, or when … - Very specific: line 19
Hosted multi-tenant API (
ContextDB Cloud): Use contextdb-cloud-client (Python) or @contextdb/cloud (TypeScript) against … - Very specific: line 21
When NOT to use: If a user requires zero storage / zero retention for a turn, do not call add or remember.
≈ “Common” is an estimate: at least 1 in 5 of the 3,592 llms.txt 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
# pycontextdb (ContextDB Open-Source Python SDK)
> Apache-2.0 Python memory engine for AI agents (`pip install pycontextdb`) with epistemic provenance (`user_stated` / `agent_inferred` / `third_party`), PII redaction and encryption before embedding, temporal slot validity (`event_time` / `as_of`), hybrid BM25 + vector + graph retrieval (RRF), and slot-scoped pre-action verification (`recall_for_action` + `confirm`). Runs offline on SQLite or self-hosted on PostgreSQL/pgvector.
## Canonical URLs
- Documentation & API reference: https://contextdb.ai/docs
- AI coding-agent integration guide: https://contextdb.ai/for-agents.txt
- Hosted OAuth 2.1 MCP guide: https://contextdb.ai/mcp
- Open-core boundary: https://contextdb.ai/open-core
- Source repository: https://github.com/atomsai/contextdb
- PyPI package (`pycontextdb==0.4.9`): https://pypi.org/project/pycontextdb/
- MCP plugin & Agent Skills: https://github.com/atomsai/contextdb-mcp-plugin
- Cloud clients (`contextdb-cloud-client`, `@contextdb/cloud`) & Memory CI: https://github.com/atomsai/contextdb-clients
## Choose the right mode
- **Local / offline / self-hosted (`pycontextdb`):** Use when you want an embedded SQLite or self-hosted PostgreSQL engine in Python, or when "local only" / "no cloud" constraints apply.
- **Hosted multi-tenant API (`ContextDB Cloud`):** Use `contextdb-cloud-client` (Python) or `@contextdb/cloud` (TypeScript) against `https://api.contextdb.ai` from server-side code (`CONTEXTDB_API_KEY`).
- **OAuth 2.1 MCP connector (`https://api.contextdb.ai/mcp`):** Connect Cursor, Claude Code, Codex, VS Code, ChatGPT, or Grok with zero API keys; server binds one project and private partition.
- **When NOT to use:** If a user requires zero storage / zero retention for a turn, do not call `add` or `remember`. ContextDB does not replace your transactional system of record or enforce downstream authorization on its own.
## Install
```bash
pip install pycontextdb # SQLite + NumPy + hybrid BM25/vector RRF + trust model
pip install "pycontextdb[postgres]" # asyncpg + pgvector backend
pip install "pycontextdb[local]" # local SentenceTransformers embeddings
pip install "pycontextdb[serve]" # local HTTP + /mcp server (`contextdb serve`)
```
## Minimal Verified Example (`pycontextdb 0.4.9`)
```python
import asyncio
import contextdb
async def main() -> None:
db = contextdb.init(
user_id="cust_42",
embedding_model="mock",
llm_model="mock",
llm_api_key="mock", # omit mock args to use configured real providers
pii_action="redact",
)
async with db:
await db.factual.add(
"Thursday afternoon appointment is confirmed.",
source="user_stated",
entity="appointment",
attribute="time",
action_relevant=True,
)
await db.factual.add(
"Caller mentioned Friday might also work.",
source="agent_inferred",
entity="appointment",
attribute="backup_time",
action_relevant=True,
)
# Grounding recall (hybrid BM25 + semantic + graph RRF; supports as_of=)
grounded = await db.factual.recall("When is the appointment?", top_k=5)
# Pre-action gate confined to a specific entity + attribute slot
trusted = await db.factual.recall_for_action(
"book appointment",
entity="appointment",
attribute="time",
)
pending = await db.factual.pending_confirmations(
entity="appointment",
attribute="backup_time",
)
print(len(grounded), len(trusted), len(pending)) # -> 2 1 1
asyncio.run(main())
```
## Framework Adapters (verified signatures)
```python
from contextdb.integrations.langchain import ContextDBMemory
memory = ContextDBMemory(db, session_id="chat-1")
from contextdb.integrations.openai_tools import tool_schemas, make_tool_handlers
tools = tool_schemas()
handlers = make_tool_handlers(db)
from contextdb.integrations.crewai import ContextDBCrewMemory
crew_memory = ContextDBCrewMemory(db, top_k=5)
```
## Local HTTP & MCP Server
```bash
pip install "pycontextdb[serve]"
contextdb serve --http --host 127.0.0.1 --port 8080 --token "$CONTEXTDB_SERVE_TOKEN"
```
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.

