Skip to content

Releases: TaskForest/context-fabrica

v1.0.2

Choose a tag to compare

@jimmdd jimmdd released this 03 Jun 23:53

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

Choose a tag to compare

@jimmdd jimmdd released this 09 Apr 18:51

Fixed

  • list_all_texts() and list_all_relations() in PostgresPgvectorAdapter called non-existent self._conn() — changed to self.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

Choose a tag to compare

@jimmdd jimmdd released this 07 Apr 20:28

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

  • HybridMemoryStore is 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

  • Extractor protocol — pluggable interface for any extraction strategy
  • PythonASTExtractor — zero-dep Python extractor (classes, functions, imports, calls, inheritance)
  • extract_and_ingest() — extract from source files directly into governed memory
  • context-fabrica-extract CLI

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

  • --dsn flag for Postgres backends
  • 8 tools: remember, recall, synthesize, promote, invalidate, supersede, related, history
  • Input validation with clear error messages

Other

  • ScoringPipeline extracted for composable multi-signal scoring
  • ScoringMode type 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

Choose a tag to compare

@jimmdd jimmdd released this 04 Apr 23:52

What's New

  • MCP Server — zero-dependency context-fabrica-mcp server that exposes memory tools over stdio JSON-RPC 2.0. Any MCP-compatible client (Claude Code, Cursor, etc.) can discover and use remember, recall, synthesize, promote, invalidate, and supersede with no extra dependencies.

  • Claude Code Skills — slash commands (/remember, /recall, /synthesize, /memory-status) and a project .mcp.json for drop-in setup.

  • CLI improvements--namespace flag and occurred_from/occurred_to support in JSONL ingestion.

Setup

pip install context-fabrica

Add 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

Choose a tag to compare

@jimmdd jimmdd released this 04 Apr 22:10

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 rerankingReranker protocol with built-in TokenOverlapReranker for 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 --namespace flag and occurred_from/occurred_to in 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

Choose a tag to compare

@jimmdd jimmdd released this 04 Apr 17:26

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

Choose a tag to compare

@jimmdd jimmdd released this 02 Apr 18:53

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

  • ScoringWeights dataclass in config.py, exported from package
  • namespace field on KnowledgeRecord (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() on RecordStore protocol
  • Postgres bootstrap auto-migrates embedding vector column dimensions
  • 47 tests passing (was 42)

v0.1.2 — Adoption Fixes

Choose a tag to compare

@jimmdd jimmdd released this 02 Apr 17:46

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 everything

list_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 10

Should-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) tuples

Tests

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

Choose a tag to compare

@jimmdd jimmdd released this 02 Apr 17:39

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

  • RecordStore protocol — formal interface for storage backends (bootstrap, upsert, fetch, search, chunks, relations, promotions)
  • GraphStore protocol — formal interface for optional graph projection backends
  • SQLiteRecordStore — zero-dependency persistent storage using Python's stdlib sqlite3. Single-file database with brute-force cosine similarity search. No server required.
  • Optional graph projection — Kuzu is no longer required. If no GraphStore is provided, projection is skipped entirely.
  • Protocol-based constructionHybridMemoryStore(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

Choose a tag to compare

@jimmdd jimmdd released this 02 Apr 17:23

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: stagedcanonicalpattern
  • 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 baseline
  • FastEmbedEmbedder — lightweight ML (384-d)
  • SentenceTransformerEmbedder — production-quality semantic similarity

CLI Tools

  • context-fabrica — query from JSONL datasets
  • context-fabrica-bootstrap — Postgres schema setup
  • context-fabrica-doctor — health probe
  • context-fabrica-demo — end-to-end demo
  • context-fabrica-projector — projection worker controls
  • context-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)