Generated banner for Fidelis Memory
Generated logo for Fidelis Memory

Fidelis Memory

Memory serverOfficial Hermes Labs project

Created by Hermes Labs

Published in hermes-labs-ai/fidelis. Publisher page

25 GitHub stars

What it is

Zero-LLM agent memory for Claude Code and AI agents: local-first BM25, dense-vector, and reciprocal-rank-fusion retrieval. Returns original passages verbatim by default. Available on PyPI as fidelis-memory. Apache-2.0.
— the description by Hermes Labs

AutoGineer overview, from the brain’s own files

Fidelis is a local-first memory infrastructure designed to provide AI agents with persistent, accurate recall of stored notes. Unlike systems that rely on generative models to summarize or rewrite information, Fidelis focuses on returning original passages verbatim. It operates as a background service on the user's machine, utilizing a vector store and hybrid retrieval techniques—including BM25 and dense-vector search with reciprocal rank fusion—to ensure high-fidelity recall. By integrating via MCP, it allows agents to store, recall, correct, and inspect memory records without requiring external API keys or cloud-based storage, making it suitable for developers and autonomous agents that need to maintain context across sessions.

How it works

Memory model: Vector store

AutoGineer overview, from the brain’s own files

Fidelis runs as a background service on the user's machine, managing a local store of text and Markdown notes. When a user or agent saves a note, it is indexed using local embeddings. The system provides an MCP interface for agents to interact with this memory. Retrieval is performed through a combination of keyword-based BM25 search and dense-vector search, which can be fused to find relevant passages. The system supports versioning through corrections, allowing records to be superseded without deleting historical data.

Folders
FolderRoleFiles
.githubagent-config5
assetsattachments1
docsdocs19
examplesexamples18
scriptsscripts1
srcsource-code42
teststests67
.agentsfolder1
.hermesfolder3
Formulafolder1
benchfolder144
claude-pluginfolder4
experimentsfolder30
extensionsfolder1

Requirements

Runtimes: Python >=3.10

Databases: Chroma

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. Not scanned by AutoGineerIts dependencies are installed by pip or uv when you run it and were not scanned by AutoGineer (3 declared). https://pypi.org/project/fidelis-memory/
  2. Created by Hermes Labs. Published in hermes-labs-ai/fidelis. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Install the Fidelis memory server and initialize the background service.
  • Connect the agent to the Fidelis MCP server.
  • Use the 'fidelis_store' tool to save important facts or decisions.
  • Use the 'fidelis_recall' tool to retrieve original text based on natural language queries.
  • Use 'fidelis_correct' to update or supersede existing records while maintaining history.
  • Inspect memory status and availability using 'fidelis_health'.
“Use Fidelis to find my Atlas billing migration note. What must happen before we retry? Quote the relevant text.”
The agent queries the Fidelis memory server and returns the exact sentence: 'Do not retry until the idempotency fix is verified.'
“Store this note: The API endpoint for the user service has changed to /v2/users.”
The agent uses the fidelis_store tool to save the fact, which is then indexed and available for future retrieval.

Documentation by Hermes Labs

<!-- mcp-name: io.github.hermes-labs-ai/fidelis-memory -->

<div align="center">

Fidelis Memory

<img src="assets/fidelis-memory-artwork.png" width="420" alt="Fidelis Memory mascot" />

Your agent can forget a summary. Fidelis brings back the note.

Local memory for Codex, Claude Code, and other agents: save text across sessions and retrieve the original passage when it matters.

by Hermes Labs

PyPI · Connect an agent · Technical reference

</div>

A project summary might say “billing migration rolled back.” The original note says why it failed and do not retry until the idempotency fix is verified. When your next session depends on that condition, the missing sentence matters.

Fidelis stores your Markdown and text notes and retrieves their stored wording. Its default retrieval does not ask a generative model to rewrite your memory.

Try it with one note

This path supports Python 3.10+, macOS or Ubuntu, and a local Ollama service. Start Ollama if needed (ollama serve in a separate terminal). No model API key is required. The current release is 0.3.0rc1.

ollama pull nomic-embed-text
python3 -m venv ~/.venvs/fidelis
source ~/.venvs/fidelis/bin/activate
python3 -m pip install "fidelis-memory[hybrid]==0.3.0rc1"
fidelis init

demo_dir=$(mktemp -d)
cat > "$demo_dir/atlas.md" <<'NOTE'
Atlas billing migration:
Duplicate charges appeared in staging. Rolled back.
Do not retry until the idempotency fix is verified.
NOTE

fidelis watch "$demo_dir" --once
fidelis recall-hybrid "Atlas billing migration retry condition" --tier zero_llm

fidelis watch and fidelis recall-hybrid use the background service started by fidelis init.

Look for both the rollback and the retry condition in the retrieved text. This is retrieval of a saved note, not a generated answer. For your own files, replace "$demo_dir" with a notes directory. If retrieval fails, run fidelis health and confirm Ollama has nomic-embed-text available. Keep the virtual environment after fidelis init; the background service uses it.

What this changes on your machine: fidelis init installs a per-user background service (launchd on macOS, systemd --user on Linux) that starts fidelis-server automatically at login. fidelis watch sends the note to that server, which saves it in the local store at ~/.cogito/store by default, not in the temporary demo directory. fidelis recall-hybrid also queries that same running server and searches the whole shared store, so its results can include notes you saved earlier, not only the demo note. The watcher also records ingested files in ~/.fidelis/watched.json. To remove the default service on macOS, run fidelis init --uninstall; it stops the service and deletes the launchd plist only. On Linux, find the installed unit with systemctl --user list-unit-files '*fidelis-server*', then run systemctl --user disable --now <unit>, delete that unit file from ~/.config/systemd/user/, and run systemctl --user daemon-reload. Neither path deletes your data. The store is shared by everything you save with Fidelis, so deleting ~/.cogito/store erases all of it, not just the demo note; do that only on a throwaway install. Also delete the temporary demo directory ($demo_dir), and ~/.fidelis/watched.json if you want its record of the file path gone.

Connect an agent

Once the note is retrievable locally, install the MCP connection for your client:

fidelis mcp install --client codex
# Or, for Claude Code:
fidelis mcp install

Restart the client and try: “Use Fidelis to find my Atlas billing migration note. What must happen before we retry? Quote the relevant text.”

The client gets tools to recall, store, correct, fetch, and inspect memory. It decides when to call them; installing the connection does not make every turn recall automatically. Other clients and uninstall commands include Cursor, Gemini CLI, Copilot CLI, and OpenClaw. A separate Pi extension provides prompt-time recall.

What Fidelis preserves

  • Original wording. watch, store, and other verbatim write paths keep the text you supplied, so retrieval can return the condition that a summary might omit.

  • Local retrieval. Fast vector search is the default MCP recall path. Explicit hybrid search combines keyword and vector results without a generative LLM at its zero_llm tier; local embeddings still require Ollama.

  • Corrections over time. A correction can supersede a prior record without erasing it. Recall can show validity and historical status instead of silently replacing the old note.

Fidelis also has optional extraction and model-assisted routes. Those can transform or filter inputs; use the verbatim path when the original wording is the point. Retrieved text can still be wrong or out of date, and your agent's model provider may see it when answering.

Current scope

Fidelis 0.3.0rc1 is a single-machine pre-release, not a hosted team memory service. The LongMemEval-S retrieval run measured whether the redesigned default path retrieved material across 470 questions; it did not measure answer accuracy. See the results, user-fit guide, and security policy for deeper detail.

Full reference · Upgrade notes · Contribute · Changelog

Apache-2.0. Hermes Labs builds agentic infrastructure for autonomous systems.

WRITEUP-LONGMEMEVAL-20260423.md

cogito-ergo on LongMemEval — Benchmark Writeup

Date: 2026-04-23
Status: Reproducibility artifact. Not a leaderboard submission.
Author: Hermes Labs (roli-lpci)


What cogito-ergo is

cogito-ergo is an open-source agent memory system with two retrieval paths:

  • Path A (/recall) — atomic-fact recall. Stores 50–200 char facts. Tuned for paraphrase queries. The production path.

  • Path B (/recall_hybrid) — session-retrieval. Stores multi-turn sessions (2000+ chars). BM25 + nomic dense + RRF fusion, turn-level chunking, LLM filter tier. Tuned for LongMemEval.

This writeup covers Path B's performance on LongMemEval_S. Path A is not evaluated here — it handles a different workload.


Baseline and full result history

VersionR@1NotesLLM?
Original baseline56.0%Dense-only retrievalNo
+ nomic prefixes60.9%search_query: / search_document:No
+ BM25 hybrid73.2%BM25 + dense + RRFNo
+ Turn-level chunks66.8%Session split at turn boundariesNo
Combined (all three)83.2%Stage 1 ceiling, zero-LLMNo
+ Regex router + qwen-turbo88.9%Classify query → LLM filterSelective
+ Hardset flagship (runB, v33)93.4%37-question hardset; see integrity noteSelective
+ Runtime escalation (runO, v34)92.3%No hardset; honest baselineSelective
+ Temporal boost + runtime (runP, v35)96.4%Temporal score multiplier; no hardsetSelective

The number we report: R@1 = 96.4% (453/470) on LongMemEval_S, run ID runP-v35, 2026-04-18.

Exact command to reproduce:

cd ~/Documents/projects/cogito-ergo
python3 bench/longmemeval_combined_pipeline_v35.py \
    --data-dir ~/Documents/projects/LongMemEval/data \
    --run-id runP-v35-repro \
    --filter-model qwen-turbo   # requires DASHSCOPE_API_KEY

For zero-LLM stage only (83.2% R@1, no API key needed):

# Set --no-llm-filter flag in the pipeline script (or use bench/longmemeval_hybrid.py directly)

Why this is NOT a leaderboard submission

The gap is not the issue. The metric is.

Mastra's published 94.87% is QA accuracy (Task B) — measured with gpt-4o-mini as both reader and judge, using evaluate_qa.py from the LongMemEval repo.

cogito-ergo's 96.4% is retrieval R@1 (Task A) — measured with recall_any@1, checking whether the gold session appears in position 1 of the ranked list.

These are different tasks. Retrieval R@1 is an upper bound on QA accuracy — a system with 96.4% retrieval R@1 can achieve at most 96.4% QA accuracy (assuming perfect answer generation). Our measured QA accuracy with qwen-max is 54.2% (runJ-v33), but qwen-max is not comparable to gpt-4o-mini as a reader.

To make a legitimate leaderboard comparison we'd need to run evaluate_qa.py on our runP-v35 retrieval output using gpt-4o-mini. Estimated cost: ~$1.24. Blocked on OpenAI API key.

The path chosen is writeup, not leaderboard. Honest about what we measured.


Per-category R@1 (runP-v35, 470 questions)

CategorynR@1Notes
single-session-user64100.0%Perfect
multi-session12199.2%1 miss: 4-gold question
knowledge-update7298.6%1 miss: 2-gold routing gap
single-session-assistant5698.2%1 miss
temporal-reasoning12792.1%10 misses — hardest category
single-session-preference3086.7%4 misses — semantic gap

17 total misses at R@1. Temporal-reasoning accounts for 59% of them.


Three novel findings worth naming

1. The demotion problem

LLM reranker filters can demote gold sessions that retrieval already ranked #1. In the guard run analysis (runC), 15+ questions had gold at S1 position 1 but were demoted to position 2+ by the LLM filter. Standard RAG + LLM-reranker architectures have this failure mode; it is underreported. The verify-guard experiment attempted to fix it (restore S1 #1 if filter demotes it) but the guard activation code did not fire in runC — a bug, not a negative result.

2. Workload divergence kills transfer

Path B (session-retrieval, 96.4% on LongMemEval) scores 54% on cogito's own 31-case atomic-fact eval, vs 75% for Path A. BM25 adds noise on 50-200 char facts. The filter's 150-char snippet truncation mangles sessions. Single-workload tuning does not transfer. This is an argument for per-workload indexes rather than one unified retrieval architecture — and likely applies to any RAG system mixing short facts with long sessions.

3. The escalation rate problem

The intended escalation rate was ~10%. runP-v35 fired on 377/470 = 80% of questions. The calibration sample (65 SSU/multi-session questions) had a different confidence score distribution than preference questions, so the top1<0.8 or gap<0.07 threshold overfit. In production this would be prohibitively expensive. A proper calibration requires stratified sampling across all 6 qtypes.


What we'd change architecturally if pursuing leaderboard seriously

  1. Per-workload indexes, not a unified index. Short facts (atomic memory) and long sessions (conversation history) should not share the same BM25 + dense index. The SESSION index uses turn-level chunks (~300 chars); the FACT index uses full entries. Separate retrieval pipelines, unified routing layer.

  2. Temporal event extraction at ingest, not query time. 10/17 remaining misses are temporal-reasoning questions. The temporal boost (multiplies similarity scores for sessions whose text matches date patterns) helps (+7.1pp on TR) but is brittle. Extracting explicit event dates into a metadata field at ingest would let us answer "when did X happen last?" with a direct metadata filter rather than cosine similarity tricks.

  3. QA reader model matters as much as retrieval. Our retrieval R@1 is 96.4%; our QA accuracy is 54.2% (qwen-max). The ceiling bottleneck is not retrieval — it's the reader. For leaderboard competition the right investment is a strong reader (gpt-4o-mini level) with multi-session context assembly, not more retrieval tuning. We are past retrieval diminishing returns.


Three concrete next experiments

  1. Run evaluate_qa.py with gpt-4o-mini on runP-v35 retrieval output. Cost ~$1.24. This gives a fair comparison to Mastra's 94.87%. Requires OpenAI API key. Estimated outcome: ~94–95% QA accuracy (96.4% retrieval x ~98% reader accuracy on correct sessions).

  2. Separate indexes for atomic facts vs sessions. Hypothesis: Path A's 75% on the 31-case eval rises to 85%+ and Path B's LongMemEval score stays flat. This tests whether the regression is index pollution or query distribution mismatch.

  3. Run on LOCOMO and MemoryBench. LongMemEval_S is one benchmark. LOCOMO (personalized conversational memory, ~600 queries) and MemoryBench (structured memory retrieval) test different distribution shifts. If cogito hits 80%+ on both with the same architecture, the retrieval approach generalizes. If not, the current result is benchmark-specific.


Integrity checklist

  • [x] Evaluated on longmemeval_s_cleaned.json (September 2025 version, HF: xiaowu0162/longmemeval-cleaned), 470 non-abstention questions

  • [x] recall_any@1 definition matches LongMemEval's eval_utils.py (any gold session in top-1)

  • [x] Gold session IDs never exposed to retrieval or filter stages (code audit 2026-04-16, bench/BENCHMARK_INTEGRITY_AUDIT.md)

  • [x] Runtime-only escalation rule: top1_score < 0.8 OR gap < 0.07. No hardset derived from test inspection

  • [x] 17 misses listed by qid in results JSON

  • [ ] Mastra comparison unconfirmed: 94.87% metric type and dataset version not independently verified

  • [ ] QA accuracy (Task B) not measured with gpt-4o-mini (requires OpenAI API key)

  • [ ] Third independent reproduction run not complete


Artifacts

  • This writeup: ~/Documents/projects/cogito-ergo/WRITEUP-LONGMEMEVAL-20260423.md

  • Results JSON (per-question): ~/Documents/projects/research-corpus/agent-infra/raw/cogito-longmemeval-20260423.json

  • runP-v35 per_question: bench/runs/runP-v35/per_question.json

  • runP-v35 aggregate: bench/runs/runP-v35/aggregate.json

  • Benchmark integrity audit: bench/BENCHMARK_INTEGRITY_AUDIT.md

  • Full results history: bench/RESULTS-SUMMARY.md


Compute notes

  • Full benchmark run: 752.7 seconds (~12.5 min) on macOS ARM

  • LLM cost: ~$2.50 total for 470 questions (mostly qwen-turbo; ~$0.0053/query avg)

  • Zero-LLM stage (83.2% R@1): $0, ~90ms/query

  • Model: nomic-embed-text (local Ollama) for dense retrieval; qwen-turbo (DashScope intl) for filter

367 files · 337 not served here

Advantages

  • Retrieves original passages verbatim by default, avoiding potential inaccuracies introduced by generative summarization. evidence: README.md
  • Supports hybrid search combining BM25 and dense-vector retrieval for improved accuracy. evidence: README.md
  • Maintains historical integrity by allowing corrections to supersede records without erasing the original data. evidence: README.md

Limitations

  • Requires a local Ollama service for embedding generation. evidence: README.md
  • Currently a single-machine pre-release and not a hosted team memory service. evidence: README.md
  • Retrieved text may still be outdated or incorrect depending on the quality of the stored information. evidence: README.md

Security

Risk level: Low risk

This brain runs

Agent instructions that run or fetch something (4)

  • .agents/skills/fidelis/SKILL.md: Wiring an MCP memory tool into Claude Code, Codex, GitHub Copilot CLI, Gemini CLI, or OpenClaw via `fidelis mcp install`
  • .agents/skills/fidelis/SKILL.md: Executable name is `fidelis`, not `fidelis-memory` — `uvx fidelis-memory` fails;
  • .agents/skills/fidelis/SKILL.md: use `uvx --from fidelis-memory fidelis <cmd>`.
  • .agents/skills/fidelis/SKILL.md: install `fidelis-memory`.

Git hooks (1)

  • .pre-commit-config.yaml: bash -c 'git grep -nE "rbr_lpci" -- ":!.pre-commit-config.yaml" && exit 1 || exit 0'

MCP servers (3)

  • claude-plugin/.mcp.json (fidelis): uvx --from fidelis-memory==0.3.0rc1 fidelis mcp serve
  • gemini-extension.json (fidelis): uvx --from fidelis-memory==0.3.0rc1 fidelis mcp serve
  • mcp.json (fidelis): uvx --from fidelis-memory==0.3.0rc1 fidelis mcp serve
  • Low risk: network-instructions (.agents/skills/fidelis/SKILL.md:5)

Attribution and licence

Created by
Hermes Labs
Declared authors
  • Hermes Labs (declared in pyproject.toml)
  • Rolando Bosch Rodriguez (declared in CITATION.cff)
Publisher
Hermes Labs (Official Hermes Labs project)
Source
hermes-labs-ai/fidelis · commit 9504c4a
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Hermes Labs.

Install from source

337 of its files are not served here, so there is no ZIP. hermes-labs-ai/fidelis at 9504c4a