Facts expire
Bi-temporal storage tracks when facts were true and when the system learned them. Point-in-time queries are first-class.
Memory that knows what it knows, what it doesn't, and why it believes what it does.
Zero external dependencies. No Docker. No config files. One go get and you're running. Auto-embedding lets you skip the vector. Just send text.
db := client.MustOpen(client.Options{})
defer db.Close()
ns := db.Namespace("my-app", namespace.ModeGeneral)
ns.Write(ctx, client.WriteRequest{
Content: "Go 1.22 added routing patterns to net/http",
SourceID: "docs-crawler",
})
results, _ := ns.Retrieve(ctx, client.RetrieveRequest{
Text: "What changed in Go 1.22?", TopK: 5,
})from contextdb import ContextDB
db = ContextDB("http://localhost:7701")
ns = db.namespace("my-app", mode="general")
ns.write(content="Go 1.22 added routing patterns", source_id="docs-crawler")
results = ns.retrieve(text="What changed in Go 1.22?", top_k=5)import { ContextDB } from "contextdb";
const db = new ContextDB("http://localhost:7701");
const ns = db.namespace("my-app", "general");
await ns.write({ content: "Go 1.22 added routing patterns", sourceId: "docs-crawler" });
const results = await ns.retrieve({ text: "What changed in Go 1.22?", topK: 5 });# Write
curl -X POST http://localhost:7701/v1/namespaces/my-app/write \
-H "Content-Type: application/json" \
-d '{"content": "Go 1.22 added routing patterns", "source_id": "docs-crawler"}'
# Retrieve
curl -X POST http://localhost:7701/v1/namespaces/my-app/retrieve \
-H "Content-Type: application/json" \
-d '{"text": "What changed in Go 1.22?", "top_k": 5}'Every retrieval result is scored by a weighted combination of four dimensions:
score = w_sim * cosine_similarity(candidate, query)
+ w_conf * confidence
+ w_rec * exp(-alpha * age_hours)
+ w_util * utility_feedbackAll weights are normalised at query time. You supply alpha (decay rate) and the four weights, or use namespace mode defaults.
| Mode | Backend | Use case |
|---|---|---|
| Embedded | In-memory or BadgerDB | Development, testing, sidecars, CLIs |
| Standard | Postgres + pgvector | Production single-node, teams |
| Remote | gRPC to contextdb server | Microservices, multi-language clients |
| Scaled | Qdrant + Redis + Postgres | High-throughput production |
| Mode | Best for | Key weight |
|---|---|---|
belief_system | Fact tracking, poisoning resistance | confidence |
agent_memory | Agentic workflows with task feedback | utility + recency |
general | Balanced RAG, document retrieval | similarity |
procedural | Skill and workflow storage | confidence, slow decay |
| Feature | Description |
|---|---|
| Auto-embedding | Text automatically embedded via OpenAI, local, or custom providers with LRU cache |
| Conflict detection | Near-duplicate scan, contradiction tracking, contradicts edges |
| Credibility learning | Bayesian source trust updates based on validation/refutation |
| Reranking | Optional LLM cross-encoder reranking after fusion |
| Label filtering | Filter retrieval by node labels |
| Background workers | Memory consolidation and active recall |
| RBAC | Token-based read/write/admin permissions per tenant |
| Snapshot/restore | NDJSON namespace export and import |
| Python SDK | REST client for Python applications |
| TypeScript SDK | REST client for TypeScript/Node.js applications |
| Scaled deployment | Qdrant + Redis + Postgres for high throughput |
| Benchmarks | MTEB, adversarial, LongMemEval, fitness suite |
| Admin UI | Built-in dashboard on observe port |
Features that make AI memory auditable and trustworthy:
| Feature | Description |
|---|---|
| Belief reconciliation | Structured disagreements between agents with evidence chains |
| Narrative retrieval | "Walk me through what you know about X and why" with full citations |
| Knowledge gap detection | "What don't I know?" Sparse region detection with acquisition suggestions |
| Calibration | Brier score, ECE, Platt scaling. Confidence becomes calibrated probability |
| GDPR erasure | Audit-trailed right-to-erasure across graph, vectors, KV, and event log |
| Interference detection | Low-credibility sources can't erode well-established claims |
| Claim federation | Gossip-based multi-instance replication with Beta-space credibility merge |
| Cascade retraction | Non-destructive "I take this back" that cascades through derived claims |
| Active learning | System recommends what information to acquire next |
| Query DSL | Pipe syntax and CQL with temporal, graph, and weight clauses |
Built with Go. No CGO. Single binary. Scratch Docker image.