
gaius
by jkubo
gaius
Ops memory lifecycle manager for AI coding agents.
Not another RAG chatbot memory — a production-grade system that extracts facts from Claude Code, Gemini CLI, Grok, and Codex sessions, ranks them into an inject-ready corpus, enforces behavioral gates, and prevents you from breaking prod at 3am.
Why gaius — three things most agent-memory tools skip:
- Runs unattended — extract → promote → inject with no human in the hot path; correction is optional.
- Prevents actions, not just recalls them — hard gates
exit:2on force-push, unconfirmed live-trade, prod-delete.- Fully offline — BM25 + sqlite-vec in one SQLite file. No API keys, no cloud.
# CLI (offline core). Extras: [semantic], [mcp]
pip install gaius-memory
# Or with uv / Claude Code MCP (see .mcp.json):
# uvx --from "gaius-memory[mcp]" gaius-mcp
#
# Tip: for unreleased mainline, pin git:
# pip install "gaius-memory @ git+https://github.com/jkubo/gaius"
⚠️ Install name is
gaius-memory, not baregaius. PyPI already has an unrelated package namedgaius(ImmobilienScout24 deploy client v145+). That package owns neither our import path nor our CLI forever, butpip install gaiuswill not install this project. Always:pip install gaius-memory→ importgaius, console scriptgaius.
gaius retire # scan sessions → stage summaries
gaius batch # (optional) review + correct — facts inject by default
gaius inject --task "what you're working on" # inject context into active session
What It Does
Engineers running Claude Code all day generate enormous amounts of institutional knowledge that vanishes when the context window closes. gaius captures it:
- Extract — scans Claude Code (and Gemini CLI) session JSONLs, extracts compact summaries with typed signals (knowledge, patterns, errors)
- Review (optional) — extracted facts are promoted and inject-eligible by default; review is a correction loop, not a gate before entry.
rejectdrops a bad fact,deferpunts it,agent-reviewclears it from the queue without touching its rank,confirmpins a verified one — while decay, dedup, and mnemosyne health checks keep quality up without a human bottleneck. - Index — promotes extracted facts into a hybrid keyword + semantic SQLite database (
facts.db) - Inject — at task start, retrieves relevant facts and loads skills context into the session
- Coordinate — cross-session claims, shared findings, and a claimable task pool (
gaius concord) so parallel sessions on one machine divide work instead of colliding
Benchmark
The demo below is a regression / smoke check, NOT a quality score: it confirms retrieval still works on a fresh clone. A perfect score on a hand-built 27-fact corpus (same author wrote the facts and the queries) proves the pipeline runs, nothing more. Real quality is the External evaluation section below, on a benchmark gaius didn't build.
bench_inject.py builds a throwaway SQLite corpus from benchmarks/demo_corpus/:
$ python3 benchmarks/bench_inject.py
gaius Injection Benchmark (25 queries, bundled demo corpus)
════════════════════════════════════════════════════════════
Recall: 25/25 (100%) regression check, NOT a quality score
Prec-warn: 3/25
Corpus: 27 demo facts (throwaway SQLite, no daemon, ~0.08s/query)
Semantic mode (embed daemon, real corpus):
Cold start: ~7s (first query, model load)
Daemon warm: ~8ms (Unix socket, model kept in memory)
Storage: sqlite-vec (384-dim, all-MiniLM-L6-v2) + BM25 in a single SQLite file
No API keys, no cloud, runs entirely offline.
External evaluation (L
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access