Releases: TaskForest/context-fabrica
Release list
v1.0.2
Changes
- Prefer real local embedders by default, with hash as explicit/fallback behavior.
- Add MCP embedder selection flags and read-only mode.
- Make MCP recall concise by default, add tunable verbosity/max_chars, and add get for full-record expansion.
- Preserve formatting and prefer paragraph/line boundaries when chunking text.
- Document the updated embedder and MCP behavior.
v1.0.1
Fixed
list_all_texts()andlist_all_relations()inPostgresPgvectorAdaptercalled non-existentself._conn()— changed toself.connect()- Bootstrap index creation now uses IVFFlat for embedding dimensions >2000 (pgvector HNSW limit), instead of failing
Full Changelog: v1.0.0...v1.0.1
v1.0.0 — Unified Architecture
Breaking Changes
DomainMemoryEngine has been removed. Use HybridMemoryStore directly:
# Before
from context_fabrica import DomainMemoryEngine
engine = DomainMemoryEngine()
# After
from context_fabrica import HybridMemoryStore, SQLiteRecordStore
store = HybridMemoryStore(store=SQLiteRecordStore("./memory.db"))
store.bootstrap()What's New
Unified Architecture
HybridMemoryStoreis the single entry point for both storage and scoring- No more dual-system split — one query path with all scoring signals
- BM25 and graph indexes bootstrap lazily from the store (no full RAM hydration)
- All features (temporal, reranking, namespace policies) work with any backend
Knowledge Extraction
Extractorprotocol — pluggable interface for any extraction strategyPythonASTExtractor— zero-dep Python extractor (classes, functions, imports, calls, inheritance)extract_and_ingest()— extract from source files directly into governed memorycontext-fabrica-extractCLI
Multi-Platform Agent Support
context-fabrica-install # auto-detect
context-fabrica-install --platform codex # explicit
context-fabrica-install --all # all platforms| Platform | Status |
|---|---|
| Claude Code | Supported (.mcp.json + slash commands) |
| Codex (OpenAI) | Supported (AGENTS.md + config.toml) |
| OpenCode | Supported (AGENTS.md + opencode.json) |
| OpenClaw | Supported (AGENTS.md + config.json) |
| Factory Droid | Supported (AGENTS.md + droid file) |
MCP Server
--dsnflag for Postgres backends- 8 tools: remember, recall, synthesize, promote, invalidate, supersede, related, history
- Input validation with clear error messages
Other
ScoringPipelineextracted for composable multi-signal scoringScoringModetype exported- Full docstrings on all public methods
- 108 tests passing
Full Changelog: https://github.com/TaskForest/context-fabrica/blob/main/CHANGELOG.md
v0.5.0
What's New
-
MCP Server — zero-dependency
context-fabrica-mcpserver that exposes memory tools over stdio JSON-RPC 2.0. Any MCP-compatible client (Claude Code, Cursor, etc.) can discover and useremember,recall,synthesize,promote,invalidate, andsupersedewith no extra dependencies. -
Claude Code Skills — slash commands (
/remember,/recall,/synthesize,/memory-status) and a project.mcp.jsonfor drop-in setup. -
CLI improvements —
--namespaceflag andoccurred_from/occurred_tosupport in JSONL ingestion.
Setup
pip install context-fabricaAdd to your .mcp.json:
{
"mcpServers": {
"context-fabrica": {
"command": "context-fabrica-mcp",
"args": ["--db", "./memory.db"]
}
}
}Full Changelog: https://github.com/TaskForest/context-fabrica/blob/main/CHANGELOG.md
v0.4.0
What's New
- Temporal retrieval — time-aware scoring with occurrence windows and time-scoped queries (e.g. "what happened in June 2025?")
- Namespace policies — per-namespace retrieval controls for confidence floors, source allowlists, hop defaults, and reranking
- Observation synthesis — combine multiple facts into provenance-backed observation records via
synthesize_observation() - Optional reranking —
Rerankerprotocol with built-inTokenOverlapRerankerfor second-stage precision
Other Changes
- Scoring weights are now normalized at query time (custom weights don't need to sum to 1.0)
- SQLite and Postgres adapters persist occurrence windows
- CLI supports
--namespaceflag andoccurred_from/occurred_toin JSONL ingestion - 68 tests covering all new features
Full Changelog: https://github.com/TaskForest/context-fabrica/blob/main/CHANGELOG.md
v0.3.0 — Supersession, RRF, Feedback Loops
Changelog
0.3.0
Added
- in-memory hybrid retrieval engine
- Postgres + pgvector canonical store
- Kuzu projection worker and queue controls
- staged/canonical/pattern memory tiers
- bootstrap, demo, doctor, projector, and project-memory CLIs
- verified package install path and source-first runtime path
- examples, getting-started guide, CI workflow, and release-facing docs
- projector replay controls and health checks
v0.2.0 — Namespaces, Lifecycle, Configurable Scoring
context-fabrica v0.2.0
Major feature release: multi-tenant isolation, memory lifecycle management, and configurable scoring.
Configurable Scoring Weights
Ranking weights are no longer hardcoded. Pass ScoringWeights to tune retrieval per domain or agent:
from context_fabrica import DomainMemoryEngine, ScoringWeights
engine = DomainMemoryEngine(
weights=ScoringWeights(
semantic=0.60, # boost semantic signal
graph=0.20,
recency=0.15,
confidence=0.05,
semantic_embedding=0.80, # 80% embedding, 20% BM25 in hybrid mode
semantic_bm25=0.20,
)
)Multi-tenant Namespaces
KnowledgeRecord now has a namespace field (default: "default"). All query, search, and list operations support namespace filtering for agent/team isolation on shared storage:
engine.ingest("...", namespace="team-alpha")
engine.query("...", namespace="team-alpha")
store.list_records(namespace="team-alpha")
store.semantic_search(embedding, namespace="team-alpha")Memory Lifecycle Policies
Three new methods on both SQLiteRecordStore and PostgresPgvectorAdapter:
# Soft-expire records older than 90 days
store.expire_records(before=datetime.now(tz=utc) - timedelta(days=90))
# Decay confidence by 5% for records older than 30 days
store.decay_confidence(older_than_days=30, decay_factor=0.95)
# Hard-delete all expired records
store.purge_expired()Embedding Dimension Bootstrap Fix
Bootstrap now auto-migrates the embedding column when dimensions change. If you created a schema at 1536 and switch to 3072 (Gemini, OpenAI large), bootstrap will ALTER COLUMN and rebuild the HNSW index automatically. No more manual DROP INDEX + ALTER TABLE.
Full changelog
ScoringWeightsdataclass inconfig.py, exported from packagenamespacefield onKnowledgeRecord(default"default")- Namespace filtering in
engine.query(),list_records(),semantic_search() - Namespace column + index in both Postgres and SQLite schemas
expire_records(),decay_confidence(),purge_expired()onRecordStoreprotocol- Postgres bootstrap auto-migrates embedding vector column dimensions
- 47 tests passing (was 42)
v0.1.2 — Adoption Fixes
context-fabrica v0.1.2
Fixes real issues found during integration with mission control.
Must-fix (blocked adoption)
semantic_search returns complete records — previously only returned 7 fields, missing tags, metadata, timestamps. Callers lost provenance info they stored. Now returns full KnowledgeRecord with all fields.
delete_record() — new method on protocol and both adapters. Cascades to chunks, relations, promotions, and projection jobs. No more raw SQL for deletes.
store.delete_record("record-id") # cascades everythinglist_records() — new method for listing/filtering records by domain and stage without raw SQL.
store.list_records(domain="platform") # all platform records
store.list_records(domain="platform", stage="canonical") # only canonical
store.list_records(limit=10) # most recent 10Should-have (developer experience)
from_dsn() convenience constructor — one-liner Postgres setup:
adapter = PostgresPgvectorAdapter.from_dsn("postgresql:///my_db")
adapter = PostgresPgvectorAdapter.from_dsn("postgresql:///my_db", embedding_dimensions=3072)Batch upsert — single-transaction bulk imports:
store.upsert_records([record1, record2, record3])fetch_record_with_chunks() — get a record and its embeddings in one call:
record, chunks = store.fetch_record_with_chunks("record-id")
# chunks: list of (text, embedding, chunk_index) tuplesTests
42 tests passing (was 37). Added tests for delete cascade, list filtering, batch upsert, fetch with chunks, and complete record verification in semantic search results.
v0.1.1 — Pluggable Storage & SQLite Adapter
context-fabrica v0.1.1
Pluggable Storage Architecture
HybridMemoryStore now accepts any backend implementing the RecordStore protocol — no longer locked to Postgres + Kuzu.
# Zero-setup with SQLite
store = HybridMemoryStore(store=SQLiteRecordStore("./memory.db"))
# Production with Postgres
store = HybridMemoryStore(store=PostgresPgvectorAdapter(settings))
# Bring your own
store = HybridMemoryStore(store=MyCustomAdapter())Added
RecordStoreprotocol — formal interface for storage backends (bootstrap, upsert, fetch, search, chunks, relations, promotions)GraphStoreprotocol — formal interface for optional graph projection backendsSQLiteRecordStore— zero-dependency persistent storage using Python's stdlibsqlite3. Single-file database with brute-force cosine similarity search. No server required.- Optional graph projection — Kuzu is no longer required. If no
GraphStoreis provided, projection is skipped entirely. - Protocol-based construction —
HybridMemoryStore(store=..., graph=...)alongside backward-compatible settings-based construction - 9 new SQLite storage tests, 3 new hybrid storage tests (37 total passing)
Storage Tiers
| Backend | Dependencies | Server? | Best for |
|---|---|---|---|
| SQLite (built-in) | None | No | Local dev, getting started |
| Postgres + pgvector | psycopg, pgvector |
Yes | Production, multi-agent |
| Kuzu (optional) | kuzu |
No | Graph-heavy traversal |
| Custom | You decide | You decide | LanceDB, DuckDB, etc. |
README
- Added "Core vs Extensible" architecture diagram
- Added "Storage Options" section with all backends documented
- Added "Bring your own backend" guide with protocol reference
- Updated project structure to label core vs pluggable components
- Updated roadmap with completed items checked off
v0.1.0 — Initial Release
context-fabrica v0.1.0
First public release of the hybrid memory substrate for AI agents.
Core Engine
- In-process hybrid retrieval: embedding similarity + BM25 lexical boost + knowledge graph traversal
- Configurable scoring modes:
hybrid(default),embedding-only,bm25-only - Entity/relation extraction with heuristic fallback — or pass your own from an upstream LLM
- Curated memory tiers:
staged→canonical→pattern - Soft invalidation with validity windows (
valid_from/valid_to) - Promotion provenance tracking
Storage Layer (v2)
- Postgres + pgvector as write authority (records, chunks, embeddings, relations)
- Kuzu as optional read-optimized graph projection
- LISTEN/NOTIFY for low-latency projection job pickup with polling fallback
- HybridMemoryStore orchestrates both stores
Embedders
HashEmbedder— zero-dependency deterministic baselineFastEmbedEmbedder— lightweight ML (384-d)SentenceTransformerEmbedder— production-quality semantic similarity
CLI Tools
context-fabrica— query from JSONL datasetscontext-fabrica-bootstrap— Postgres schema setupcontext-fabrica-doctor— health probecontext-fabrica-demo— end-to-end democontext-fabrica-projector— projection worker controlscontext-fabrica-project-memory— repo-local memory bootstrap
Tests
- 25 tests covering engine, policy, embedding, storage, and projection
- CI via GitHub Actions (Python 3.11, ubuntu-latest)