Generated banner for AutoMem
Generated logo for AutoMem

AutoMem

Memory framework

First committed by jack-arturo

Published in verygoodplugins/automem. Publisher page

827 GitHub stars

What it is

Long-term memory for AI assistants. Graph + vector store that recalls decisions, relationships, and context across sessions.
— the description by jack-arturo

AutoGineer overview, from the brain’s own files

AutoMem is a memory service designed to provide AI assistants with persistent, long-term recall. By combining a graph database (FalkorDB) for structured relationships and a vector database (Qdrant) for semantic search, it enables agents to retrieve not just similar snippets, but the context and reasoning behind past decisions. It supports a wide range of AI tools via the Model Context Protocol (MCP) and a REST API, allowing a single memory store to be shared across multiple platforms like Claude, Cursor, and GitHub Copilot. The system includes automated consolidation cycles to manage memory relevance and importance over time, ensuring that the agent's knowledge base remains efficient as history grows.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

AutoMem operates as a service with two primary storage layers: FalkorDB for storing memories as nodes with typed relationships, and Qdrant for storing vector embeddings. When an AI client requests a recall, the system performs a hybrid query that combines semantic similarity, graph traversal, and temporal alignment to rank results. A background enrichment pipeline and consolidation engine process memories to maintain relevance, while the MCP bridge allows various AI agents to interact with the memory service locally or remotely.

Folders
FolderRoleFiles
.githubagent-config9
docsdocs18
scriptsscripts39
teststests78
.railwayfolder2
automemfolder70
benchmarksfolder9
mcp-sse-serverfolder14

The agent reads

The agent writes

Requirements

Runtimes: Python

Databases: FalkorDB, MongoDB, PostgreSQL, Qdrant, Redis, SQLite

API keys (by name): ADMIN_API_TOKEN, AUTOMEM_API_TOKEN, AUTOMEM_TEST_ADMIN_TOKEN, AUTOMEM_TEST_API_TOKEN, CLASSIFICATION_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, QDRANT_API_KEY, VOYAGE_API_KEY

Works with: Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Kiro, OpenCode, Amp, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 1 script. Review Makefile before opening the folder in Claude Code. No step below turns a hook on for you.

    • Makefile: echo "🔧 Setting up development environment..."; bash scripts/bootstrap_dev.sh; echo "✅ Virtual environment ready!"; echo "💡 Run 'source .venv/bin/activate' to activate"
  2. Not scanned by AutoGineerThe author’s README also describes installing it from a clone of its repository. Read its install section: AutoGineer did not scan that path. https://github.com/verygoodplugins/automem/blob/1a7ba1a6afe69835f62ad7f6013e33301d1ab83e/README.md#run-it
  3. First committed by jack-arturo. Published in verygoodplugins/automem. Licence: MIT License.

Usage

AutoGineer overview, from the brain’s own files

  • Connect local AI tools like Claude Desktop or Cursor to the AutoMem service via the MCP bridge.
  • Use the REST API to programmatically store decisions, preferences, and project context.
  • Query the memory service to retrieve the reasoning behind past technical choices or project milestones.
  • Deploy the memory service on local infrastructure or cloud platforms like Railway for persistent agent access.
“Why did we choose PostgreSQL?”
The agent retrieves the decision node, the rationale, and the considered alternatives, providing the context behind the architectural choice.
“What are our current preferences for message queues?”
The agent traverses the graph to identify the relationship between Kafka and RabbitMQ, surfacing the team's preference for 'boring technology'.

Documentation by jack-arturo

<p align="center"> <img src="https://automem.ai/img/G_Vd7EYWYAM_3SF.jpeg" alt="AutoMem" width="600" /> </p>

<p align="center"> <a href="https://www.npmjs.com/package/@verygoodplugins/mcp-automem"><img src="https://img.shields.io/npm/v/@verygoodplugins/mcp-automem?label=mcp-automem" alt="npm version" /></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/verygoodplugins/automem" alt="License" /></a> <a href="https://automem.ai/discord"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a> <a href="https://x.com/automem_ai"><img src="https://img.shields.io/badge/X-@automem__ai-000000?logo=x&logoColor=white" alt="X" /></a> <a href="https://automem.ai/benchmarks"><img src="https://img.shields.io/badge/LoCoMo%20(AMB)-85.1%25-success" alt="LoCoMo on the neutral Agent Memory Benchmark" /></a> <a href="benchmarks/EXPERIMENT_LOG.md#results"><img src="https://img.shields.io/badge/LongMemEval%20full-87.0%25-blueviolet" alt="LongMemEval full on AutoMem's internal harness: 87.0%" /></a> <a href="https://automem.ai/benchmarks"><img src="https://img.shields.io/badge/BEAM%2010M%20(AMB)-57.4%25-success" alt="BEAM 10M on the neutral Agent Memory Benchmark" /></a> <a href="https://railway.com/deploy/automem-ai-memory-service?referralCode=VuFE6g&utm_medium=integration&utm_source=github&utm_campaign=generic"><img src="https://img.shields.io/badge/Deploy%20on-Railway-0B0D0E?logo=railway&logoColor=white" alt="Deploy on Railway" /></a> </p>

<p align="center"> <strong>Long-term memory for AI assistants — fast, private, and yours.</strong> </p>

AutoMem

AutoMem gives your AI a memory that survives the chat.

Save the decisions, preferences, notes, and context that matter. The next time you open Claude, Cursor, Codex, ChatGPT, or another connected assistant, it can bring back the right details instead of making you repeat yourself.

Ask, “Why did we choose PostgreSQL?” and AutoMem can return the decision, the alternatives you considered, the principle behind it, and the work that followed — not just a pile of similarly worded snippets.

Why AutoMem feels different

No LLM call in the middle of recall. AutoMem looks up memories directly through its graph and vector index. That keeps normal retrieval fast and avoids an extra generative-LLM charge every time your assistant needs context. It still uses embeddings — from Voyage, OpenAI, or a local provider — and optional enrichment can add more structure over time.

More than vector search. A vector match finds something similar; AutoMem also records typed relationships between memories. It can follow the connections between a decision, its rationale, and its consequences, so your assistant has a better chance of returning the why, not only the words it recognizes.

One memory across your tools. Use the local MCP bridge with Claude Desktop, Cursor, Claude Code, Codex, Copilot, and more. For cloud agents, Remote MCP connects the same service to ChatGPT Developer Mode, Claude.ai, and ElevenLabs over HTTPS. Your memory is not locked to one chat app.

Own the data and the setup. Run AutoMem locally with Docker, on your own infrastructure, or as a small Railway service group. It exposes both MCP and a REST API, so it fits into the tools and workflows you already use.

Proven where long context gets hard

On the independent Agent Memory Benchmark's BEAM long-context tests, AutoMem scored 57.4% at 10 million source tokens while giving the answerer an average of only ~2.6–4.8k retrieved tokens. That is the kind of efficiency that lets memory stay useful as an agent's history grows.

The full picture — test setup, raw outputs, methodology, historical runs, and reproduction commands — is in automem.ai/benchmarks and benchmarks/EXPERIMENT_LOG.md.

How it works

AutoMem combines two storage layers behind a single API:

  • FalkorDB stores memories as nodes with 11 typed relationships between them. The graph is the canonical record.

  • Qdrant stores an embedding for every memory. Recall is a hybrid query — semantic similarity, graph traversal, temporal alignment, tag overlap, and importance — ranked by a 9-component score.

flowchart TB
    subgraph service [AutoMem Service Flask]
        API[REST API<br/>Memory Lifecycle]
        Enrichment[Background Enrichment<br/>Pipeline]
        Consolidation[Consolidation<br/>Engine]
        Backups[Automated Backups<br/>Optional]
    end

    subgraph storage [Dual Storage Layer]
        FalkorDB[(FalkorDB<br/>Graph Database)]
        Qdrant[(Qdrant<br/>Vector Database)]
    end

    Client[AI Client] -->|Store/Recall/Associate| API
    API --> FalkorDB
    API --> Qdrant
    Enrichment -->|11 edge types<br/>Pattern nodes| FalkorDB
    Enrichment -->|Semantic search<br/>1024-d vectors| Qdrant
    Consolidation --> FalkorDB
    Consolidation --> Qdrant
    Backups -.->|Optional| FalkorDB
    Backups -.->|Optional| Qdrant

If Qdrant is unavailable, the graph still serves recall in a degraded mode. If FalkorDB is down, the API returns 503 — the graph is the source of truth.

Multi-hop bridge discovery

Ask "why boring tech for Kafka?" and AutoMem doesn't just match the word "Kafka". It traverses the graph from the seed memories to find the bridge that connects them:

  • Seed 1: "Migrated to PostgreSQL for operational simplicity"

  • Seed 2: "Evaluating Kafka vs RabbitMQ for message queue"

  • Bridge: "Team prefers boring technology — proven, debuggable systems"

Both seeds carry an EXEMPLIFIES edge to the bridge memory. AutoMem ranks the bridge above the seeds and surfaces it in the recall response, so the assistant answers with your reasoning, not isolated facts. Tune via expand_relations, relation_limit, and expansion_limit on GET /recall.

11 authorable relationship types
TypeUse caseExample
RELATES_TOGeneral connectionBug report → Related issue
LEADS_TOCausal relationshipProblem → Solution
OCCURRED_BEFORETemporal sequencePlanning → Execution
PREFERS_OVERUser preferencesPostgreSQL → MongoDB
EXEMPLIFIESPattern examplesCode review → Best practice
CONTRADICTSConflicting infoOld approach → New approach
REINFORCESSupporting evidenceDecision → Validation
INVALIDATED_BYOutdated infoLegacy docs → Current docs
EVOLVED_INTOKnowledge evolutionInitial design → Final design
DERIVED_FROMSource trackingImplementation → Spec
PART_OFHierarchical structureFeature → Epic

Three more edge types are added automatically by the enrichment pipeline and consolidation engine: SIMILAR_TO, PRECEDED_BY, and DISCOVERED.

Memory consolidation, neuroscience-inspired

AutoMem implements biological memory consolidation cycles. Wrong rabbit holes fade naturally. Important memories with strong connections strengthen over time.

CycleFrequencyPurpose
DecayDailyExponential relevance scoring (age, access, connections, importance)
CreativeWeeklyREM-like processing that discovers non-obvious connections
ClusterMonthlyGroups similar memories, generates meta-patterns
ForgetOff by defaultArchives low-relevance memories (<0.2), deletes very old (<0.05)

Tune intervals via CONSOLIDATION_*_INTERVAL_SECONDS. See docs/ENVIRONMENT_VARIABLES.md.

For more on the recall scoring formula, enrichment internals, and how AutoMem differs from RAG and pure vector databases, see docs/COMPARISON.md.

Research foundation

AutoMem implements techniques from peer-reviewed memory research:

  • HippoRAG 2 (Ohio State, 2025) — graph + vector hybrid for associative memory

  • A-MEM (2025) — Zettelkasten-inspired dynamic memory organization

  • MELODI (DeepMind, 2024) — gist-based memory compression

  • ReadAgent (DeepMind, 2024) — episodic memory for context extension

Full writeups, findings, and how AutoMem implements each → docs/RESEARCH.md.

Run it

Railway (60 seconds)

Image: Deploy on Railway

Recommended Railway projects run AutoMem as a small service group: automem (the API), automem-graph-viewer (the standalone UI), falkordb (graph), qdrant (vectors), and mcp-automem (the MCP bridge for ChatGPT, Claude.ai, and ElevenLabs). Services use pre-built Docker images and auto-redeploy on :stable, so Railway does not spend compute rebuilding source.

→ Full setup: INSTALLATION.md

Docker Compose (local)
git clone https://github.com/verygoodplugins/automem.git
cd automem
make dev
ServiceURLPurpose
AutoMem APIhttp://localhost:8001Memory REST API
FalkorDBlocalhost:6379Graph database
Qdrantlocalhost:6333Vector database
FalkorDB Browserhttp://localhost:3000Local graph inspection UI

Database and browser ports bind to localhost by default; the API binding is unchanged.

→ Full setup: INSTALLATION.md

Python (development)
make install
source .venv/bin/activate
PORT=8001 python app.py

Requires Python 3.10+ (3.12 recommended). → INSTALLATION.md

Contributing: feature PRs target the develop branch. main only moves via validated release merges, so users deploying from main (e.g. Railway auto-deploys) see one deploy per release instead of one per PR.

Connect your AI

ClientModeSetup
Claude Desktop, Cursor, Claude Code, Codex, Copilot, AntigravityLocal MCP bridgenpx @verygoodplugins/mcp-automem setup
ChatGPT (developer mode), Claude.ai web/mobile, ElevenLabs AgentsRemote MCP (HTTPS)docs/MCP_SSE.md
Anything elseDirect REST APIdocs/API.md

The MCP bridge is published as @verygoodplugins/mcp-automem. It handles client-specific config (rules files, hooks, templates) and proxies to your AutoMem service — local or Railway.

Direct API call:

import requests

token = "your-automem-api-token"

requests.post(
    "https://your-automem.railway.app/memory",
    headers={"Authorization": f"Bearer {token}"},
    json={
        "content": "Chose PostgreSQL over MongoDB for ACID compliance",
        "type": "Decision",
        "tags": ["database", "architecture"],
        "importance": 0.9,
    },
)

Screenshots

<!-- CAPTURE CHECKLIST — replace each placeholder image once captured: 1. docs/img/graph-recall.png — FalkorDB browser at http://localhost:3000 showing a memory node with multiple typed edges visible (PREFERS_OVER, EXEMPLIFIES, RELATES_TO). Proves the graph is real. 2. docs/img/claude-recall.png — Claude Desktop conversation where the assistant cites a recalled memory inline, with the AutoMem MCP tool call visible in the trace. 3. docs/img/railway-services.png — Railway dashboard showing the production service group (automem, automem-graph-viewer, mcp-automem, qdrant, falkordb). A version exists as a GitHub user-attachment in INSTALLATION.md; capture a clean version and host it in-repo. Until each PNG exists, the table cells will render as broken-image icons on GitHub. -->

Screenshots will be added once the referenced in-repo image assets are available.

Known limitations

AutoMem is pre-1.0 and honest about its rough edges. The active ones for recall quality:

  • Tags are a hard gate, not a soft boost. Tags filter before scoring, so a memory missing the queried tag won't surface even on a perfect semantic match. Within a tag scope, high-importance off-topic memories can still over-rank — mitigated by the opt-in RECALL_RELEVANCE_GATE, not yet on by default (#130).

  • Temporal and preference updates. Recall doesn't yet reliably prefer the newest version of a conflicting fact, or fully resolve multi-session preference updates. The RECALL_RECENCY_BIAS=auto re-rank helps temporal-intent queries but stays opt-in pending broader validation (#158, #159).

  • The MCP SSE bridge doesn't forward state_mode. The HTTP recall API supports it; the SSE proxy doesn't pass it through yet (#172).

  • Entity-node synthesis is experimental and off by default. First-class Entity nodes (IDENTITY_SYNTHESIS_ENABLED) are gated off while people-entity word-pair noise is addressed (#181).

Docs, community, and license

Setup

API and integration

  • API reference — endpoints, scoring, enrichment

  • Remote MCP — ChatGPT, Claude.ai, ElevenLabs

  • Migrations — embedding dimensions, 0.16.0 data migrations, MCP SQLite import

Research and comparison

Operations

Community

Sibling repos

MIT licensed. Deploy anywhere. No vendor lock-in.

docs/TESTING.md

Testing Guide

This document describes the testing setup for AutoMem and how to run tests against different environments.

Test Suite Overview

AutoMem has a comprehensive test suite covering:

  • API endpoints

  • Core functionality

  • Consolidation engine

  • Enrichment pipeline

  • Integration tests

Quick Commands

# Unit tests only (fast, no services required)
make test

# Integration tests (local Docker)
make test-integration

# Integration tests (live Railway server)
make test-live

Pytest Markers

The suite now uses explicit markers:

  • unit: Fast mocked tests (default classification).

  • integration: Docker-backed local integration tests.

  • live: Benchmarks/live-environment tests (opt-in).

Marker behavior:

  • Any test not explicitly marked integration or live is auto-classified as unit.

  • make test runs -m unit.

  • make test-integration runs -m integration with the existing env-based gate.

Test Types

flowchart TD
    Start{What are you<br/>testing?}

    Start -->|Code changes| CodeCheck{Changed<br/>API/DB logic?}
    Start -->|Pre-commit| PreCommit[Run: make test<br/>✅ Unit tests only<br/>⚡ Fast 10s]
    Start -->|Before deploy| PreDeploy{Have Railway<br/>deployed?}
    Start -->|Benchmarking| Benchmark[Run: make test-locomo<br/>📊 LoCoMo benchmark<br/>⏱️ 15-25 min]

    CodeCheck -->|No just refactor| PreCommit
    CodeCheck -->|Yes API/DB changes| Integration{Need real<br/>services?}

    Integration -->|Yes| Docker{Have Docker<br/>running?}
    Integration -->|No mock is fine| PreCommit

    Docker -->|Yes| LocalIntegration[Run: make test-integration<br/>🐳 Local Docker stack<br/>⏱️ 60s]
    Docker -->|No| LiveCheck{Have Railway<br/>access?}

    PreDeploy -->|Yes| LiveIntegration[Run: make test-live<br/>☁️ Test against Railway<br/>⏱️ 90s]
    PreDeploy -->|No| LocalIntegration

    LiveCheck -->|Yes| LiveIntegration
    LiveCheck -->|No| SetupDocker[Set up Docker first<br/>docker compose up]

    SetupDocker --> LocalIntegration

    LocalIntegration --> Success{Tests pass?}
    LiveIntegration --> Success
    PreCommit --> Success
    Benchmark --> BenchSuccess{Score acceptable?}

    Success -->|Yes| Commit[✅ Safe to commit/deploy]
    Success -->|No| Debug[🔍 Debug failures<br/>Check logs]

    BenchSuccess -->|Yes| Commit
    BenchSuccess -->|No| Optimize[🔧 Optimize recall logic]
1. Unit Tests

Command: make test

  • Fast, isolated tests using mock/stub implementations

  • No external services required

  • Tests API logic, validation, edge cases

  • Safe to run anytime

  • Internally runs: pytest -m unit

2. Integration Tests (Local)

Command: make test-integration

  • Tests against real Docker services (FalkorDB + Qdrant + API)

  • Automatically starts services with test credentials

  • Creates test memories tagged with ["test", "integration"]

  • Cleans up all test data after completion

  • Requires: Docker, Docker Compose

  • Internally runs: pytest -m integration

What it does:

  1. Starts Docker services with AUTOMEM_API_TOKEN=test-token

  2. Waits for services to be ready (5s)

  3. Runs full integration test suite

  4. Tests real database operations, embeddings, associations

3. Live Server Tests (Railway)

Command: make test-live

  • Tests against the production Railway deployment

  • Verifies local and live environments have matching behavior

  • Prompts for confirmation before running (safety measure)

  • Automatically fetches Railway credentials

  • Requires: Railway CLI, linked project (railway link)

Safety features:

  • Interactive confirmation required

  • Only creates/modifies test memories with unique UUIDs

  • All test data is cleaned up immediately

  • Read-only operations for health checks and recalls

Test Scripts

Interactive Live Testing
./test-live-server.sh

Prompts for confirmation before running against production.

Automated Live Testing
./test-live-server.sh --non-interactive

Non-interactive flag for CI/automation. The legacy test-live-server-auto.sh wraps this flag for backward compatibility.

Manual Integration Testing
./run-integration-tests.sh

Runs integration tests with proper environment setup.

Environment Variables

Required for Integration Tests
  • AUTOMEM_RUN_INTEGRATION_TESTS=1 - enables integration tests

  • AUTOMEM_TEST_API_TOKEN - API authentication token

  • AUTOMEM_TEST_ADMIN_TOKEN - admin authentication token (optional for some tests)

Optional Configuration
  • AUTOMEM_TEST_BASE_URL - override API endpoint (default: http://localhost:8001)

  • AUTOMEM_ALLOW_LIVE=1 - required to test against non-localhost URLs

  • AUTOMEM_START_DOCKER=1 - auto-start Docker services

  • AUTOMEM_STOP_DOCKER=1 - auto-stop Docker after tests (default)

Test Results

All tests are designed to pass cleanly with no unexpected warnings (filtered via pytest.ini). Use make test, make test-integration, or make test-live and rely on the pytest summary for the current counts.

Comparing Local vs Live

To verify local Docker environment matches production:

# Run tests locally
make test-integration

# Run same tests against live
make test-live

Both should produce identical results, confirming:

  • API responses match

  • Authentication works correctly

  • Database operations behave the same

  • Embeddings are generated consistently

Troubleshooting

"API not available" error

The integration tests wait up to 10 seconds for the API to be ready. If services take longer:

  • Check docker compose ps to see service status

  • Check docker compose logs flask-api for startup errors

  • Manually verify health: curl http://localhost:8001/health

"Unauthorized" errors (401)

Ensure environment variables match:

  • Local: AUTOMEM_API_TOKEN=test-token

  • Docker: Set via docker-compose.yml environment section

  • Railway: Check with railway variables

Railway CLI issues
# Install Railway CLI
npm install -g @railway/cli

# Link to project
railway link

# Verify connection
railway status

CI/CD Integration

For automated testing in CI:

# Unit tests (always safe)
make test

# Integration tests (if Docker available)
make test-integration

# Live tests (if Railway credentials available)
./test-live-server.sh --non-interactive

LoCoMo Benchmark

AutoMem can be evaluated against the LoCoMo benchmark (ACL 2024), which tests long-term conversational memory across 10 conversations and 1,986 questions.

LoCoMo Cat-5 Judge

Category 5 uses evidence-grounded complex reasoning and is opt-in for cost reasons.

# Default: categories 1-4 scored, category 5 skipped
make bench-eval BENCH=locomo-mini CONFIG=baseline

# Enable cat-5 judge with env var
BENCH_JUDGE_MODEL=gpt-5.4-mini-2026-03-17 make bench-eval BENCH=locomo-mini CONFIG=baseline

# Direct runner: 1 conversation, judge enabled
./test-locomo-benchmark.sh --conversations 0 --judge --output benchmarks/results/locomo-smoke.json

# Direct runner: mini mode (same 2 conversations as locomo-mini)
./test-locomo-benchmark.sh --conversations 0,1 --judge --output benchmarks/results/locomo-mini.json

Relevant flags for ./test-locomo-benchmark.sh:

  • --conversations I,J,... runs only the selected 0-based conversation indices from locomo10.json. Default: all 10 conversations. Example: 0 runs the first conversation only; 0,1 is the same 2-conversation scope as locomo-mini.

  • --judge enables category-5 judging. Default: disabled.

  • --judge-model MODEL enables category-5 judging and uses MODEL. Default when judge is enabled: gpt-5.4-mini-2026-03-17, unless overridden by BENCH_JUDGE_MODEL.

  • --output PATH saves JSON results to PATH. Default: no output file is written.

  • --recall-limit N sets memories recalled per question. Default: 10.

  • --live runs against Railway instead of local Docker. Default: local Docker.

  • --no-cleanup keeps benchmark test data after the run. Default: cleanup enabled.

make bench-eval wraps the snapshot-based benchmark flow and always writes results to benchmarks/results/<bench>_<config>_<timestamp>.json.

If the judge is disabled, category 5 remains N/A. If the judge is enabled but evidence is missing or the LLM response is invalid, the affected category-5 questions are skipped rather than counted wrong.

What is LoCoMo?

LoCoMo evaluates AI systems' ability to remember and reason across very long conversations (300+ turns). It measures performance across 5 categories:

  1. Single-hop Recall (Category 1) - Simple fact retrieval: "What is Caroline's identity?"

  2. Temporal Understanding (Category 2) - Time-based queries: "When did Caroline move to Sweden?"

  3. Multi-hop Reasoning (Category 3) - Connecting multiple memories: "What fields would Caroline pursue in education?"

  4. Open Domain (Category 4) - General knowledge questions

  5. Complex Reasoning (Category 5) - Advanced inference tasks

Historical note: older public LoCoMo references such as CORE's 88.24% are still useful background context, but they are not AutoMem's primary comparison target because the public setups are not perfectly apples-to-apples, especially around category-5 handling.

AutoMem currently publishes the following LoCoMo baselines:

SetupScopeScoreNotes
locomo, canonical judge on (gpt-5.4-mini-2026-03-17)Full 10 conversations84.74% (1683/1986)Current canonical full run from the May 2026 publication verification; category 5 scored 95.52% (426/446) with 0 skips/errors.
locomo, historical judge on (gpt-5.1)Full 10 conversations83.99% (1668/1986)Historical #128 full run; category 5 scored 92.83% (414/446) with 0 skips.
locomo-mini, judge off2 conversations, categories 1-4 only89.27% (208/233)Historical mini anchor after evaluator fixes; not the current headline full-run claim.
locomo, judge on (gpt-4o)Full 10 conversations87.56% (1739/1986)Historical March 2026 run; kept for trend context only.
Running the Benchmark
# Quick commands
make test-locomo              # Run locally against Docker
make test-locomo-live         # Run against Railway deployment

# With options
./test-locomo-benchmark.sh --recall-limit 20 --output results.json
./test-locomo-benchmark.sh --live --no-cleanup
What the Benchmark Tests
  1. Memory Storage: Loads ~10,000 dialog turns from 10 conversations

  2. Hybrid Recall: Tests semantic + keyword + tag-based retrieval

  3. Graph Relationships: Evaluates multi-hop reasoning via relationship traversal

  4. Temporal Queries: Tests time-based memory filtering

  5. Answer Accuracy: Checks if recalled memories contain correct answers

Performance Expectations

The benchmark takes approximately:

  • Local Docker: 10–20 minutes

  • Railway: 15–25 minutes (network latency)

Memory usage:

  • FalkorDB: ~6,000–10,000 nodes

  • Qdrant: ~6,000–10,000 vectors (1024 dimensions by default with voyage-4; older/OpenAI setups may use 768 or 3072)

Interpreting Results

Example benchmark output:

📊 FINAL RESULTS
🎯 Overall Accuracy: 84.74% (1683/1986)
⏱️ Total Time: 3164s
💾 Total Memories Stored: 5882

📈 Category Breakdown excerpt:
  Complex Reasoning        : 95.52% (426/446)

See benchmarks/EXPERIMENT_LOG.md for the full per-category table. If you run without the judge, category 5 will show as N/A.

Current baselines and methodology notes live in benchmarks/EXPERIMENT_LOG.md.

Current-State Recall Smoke

Use make bench-current-state as the no-LLM regression gate for recall state semantics. It covers active, expired, future, archived, invalidated, evolved, contradictory, replacement, and tag-gated replacement cases, plus the public state_mode=current|history contract.

The smoke target is deterministic and runs against unit fixtures, so it is appropriate for every recall contract change. Use LongMemEval or LoCoMo only when the change affects ranking, scoring, entity expansion, or answer quality.

LongMemEval Benchmark

AutoMem also includes a LongMemEval harness for milestone validation against the ICLR 2025 long-term memory dataset. Treat prefix slices as smoke tests only; cite the canonical full run or the stratified representative mini for current results.

# Representative judged mini: stratified 5 questions per question type (30 total)
make bench-mini-longmemeval

# Prefix smoke only; biased by dataset order
./test-longmemeval-benchmark.sh --max-questions 20

# Full local run
make test-longmemeval

# Full live Railway run
make test-longmemeval-live

Answer-construction prompt variants are harness-only experiments. The evidence-answer config enables an explicit evidence-first answer prompt for #200 probes; it does not change /recall, graph expansion, vector retrieval, or production API behavior. As of the 2026-07-07 mini A/B, evidence-answer trailed the same-day temporal-answer control, so it is not a promoted LongMemEval default.

Current LongMemEval results:

SetupScopeScoreRetrievalNotes
longmemeval-mini representative30 questions, stratified 5 per question type70.00% (21/30)recall@5 96.67% (29/30)Fresh publication verification run: gpt-5-mini answerer, script LLM eval, 2 empty-answer warnings.
longmemeval full canonical500 questions87.00% (435/500)recall@5 97.00% (485/500)Fresh publication verification run: gpt-5-mini answerer, gpt-5.4-mini-2026-03-17 judge, judge_errors=0, memory_ingest_failures=0, publishable=true.
longmemeval full historical500 questions86.20% (431/500)recall@5 97.20% (486/500)April 2026 canonical milestone with the same answerer and judge policy; kept for trend context.
longmemeval partial legacy prefix (50q)50 questions, single-session-user type82.0% (41/50)recall@5 92.0% (46/50)Provisional prefix run with legacy gpt-4o answerer; recall_limit=10, no entity/relation expansion. Not reproduced by the current stratified bench-mini-longmemeval target and not directly comparable to the older 35.6% / 500-question setup.

For future published LongMemEval results, use the pinned judge policy in docs/BENCHMARK_JUDGE_POLICY.md so runs remain comparable over time. The primary answerer is gpt-5-mini; gpt-4o is legacy continuity only and should be labeled as such. Result metadata distinguishes the answer model (answerer_model / llm_model) from the judge model (judge_model, currently gpt-5.4-mini-2026-03-17 when --llm-eval is enabled).

BEAM Benchmark

BEAM experiments currently live in automem-evals, because the harness is exploratory and wraps the upstream memory-benchmarks runner through an AutoMem shim. The durable findings are summarized here because official benchmark claims and docs references belong in this repo.

Current BEAM 100K diagnostic results:

SetupScopeScoreNotes
V1 raw-dialogue shim20 conversations, 400 questions76.25% (305/400), avg 0.677gpt-5-mini answerer/judge, top-k 200, zero errors.
V2 fact-extraction shim20 conversations, 400 questions73.75% (295/400), avg 0.653-2.50pp vs V1 overall. Abstention and knowledge_update improved; event_ordering and information_extraction regressed.

Do not read the BEAM 100K number as an apples-to-apples product comparison with mem0's published 1M/10M results. The 100K tier is an easier retrieval setting, and the shim/judge setup differs from the published comparison target. It is useful as a failure-mode and regression signal.

Benchmark Ownership

automem is the canonical home for official benchmark harnesses, published baselines, and any benchmark numbers referenced in docs, CI, or release notes.

Use the separate automem-evals repo for:

  • ruleset experimentation

  • scenario authoring and seeded corpora

  • cross-agent or cross-backend comparisons

  • bulky timestamped result artifacts and exploratory writeups

Memora/FAMA and WRIT runs remain diagnostic unless their scenario, harness, and result artifacts are promoted into this repo's official benchmark flow and recorded in benchmarks/EXPERIMENT_LOG.md.

If you are building an external eval harness against local AutoMem, use the contract in EVALS_CONTRACT.md and treat this repo as the system under test.

AutoMem's Advantages

AutoMem is expected to perform well due to:

  1. Richer Graph: 11 relationship types, beyond simple temporal-link-only baselines

    • RELATES_TO, LEADS_TO, OCCURRED_BEFORE

    • PREFERS_OVER, EXEMPLIFIES, CONTRADICTS

    • REINFORCES, INVALIDATED_BY, EVOLVED_INTO

    • DERIVED_FROM, PART_OF

  2. Hybrid Search: Vector + keyword + tags + importance + time

    • Designed to recover both semantic matches and explicit structured context

    • Useful for testing graph/vector tradeoffs against snapshot-based evals

  3. Background Intelligence:

    • Entity extraction for structured queries

    • Pattern detection for common themes

    • Consolidation for improved relevance

  4. Dual Storage: FalkorDB + Qdrant provides redundancy and complementary retrieval

Benchmark Setup

The LoCoMo benchmark is automatically cloned during first run:

tests/benchmarks/locomo/
├── data/
│   └── locomo10.json          # 10 conversations, 1,986 questions
├── task_eval/                 # Evaluation utilities
└── README.MD                  # Benchmark documentation
Troubleshooting

"LoCoMo dataset not found"

cd tests/benchmarks
git clone https://github.com/snap-research/locomo.git

Low accuracy scores

  • Check if enrichment pipeline is enabled

  • Verify OpenAI API key is set (for embeddings)

  • Increase --recall-limit (default: 10)

  • Review individual question results in output JSON

Timeout errors

  • Reduce batch size in config

  • Increase pause between batches

  • Use Railway for better performance

Research Citation
@article{maharana2024evaluating,
  title={Evaluating very long-term conversational memory of llm agents},
  author={Maharana, Adyasha and Lee, Dong-Ho and Tulyakov, Sergey and Bansal, Mohit and Barbieri, Francesco and Fang, Yuwei},
  journal={arXiv preprint arXiv:2402.17753},
  year={2024}
}

Best Practices

  1. Always run unit tests before committing

  2. Run integration tests when changing API logic or database operations

  3. Run live tests before deploying to verify no regressions

  4. Check test coverage with pytest --cov (requires pytest-cov)

  5. Review test output - integration tests show actual API responses

  6. Run LoCoMo benchmark before major releases to validate memory performance

273 files · 249 not served here

Advantages

  • Avoids redundant LLM calls during recall by using direct graph and vector index lookups. evidence: README.md
  • Records typed relationships between memories to surface the 'why' behind decisions rather than just isolated facts. evidence: README.md
  • Provides a unified memory store accessible across multiple different AI tools and chat applications. evidence: README.md

Limitations

  • Tags act as a hard filter, meaning memories without the queried tag are excluded even if they are semantically relevant. evidence: README.md
  • The system does not yet reliably resolve conflicting facts or prioritize the newest version of information automatically. evidence: README.md
  • The MCP SSE bridge currently lacks support for passing through state_mode configurations. evidence: README.md

Security

Risk level: Medium risk

This brain runs

Git hooks (8)

  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/psf/black at 24.4.2 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/pycqa/isort at 5.13.2 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/pycqa/flake8 at 7.1.1 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/compilerla/conventional-pre-commit at v3.2.0 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/pre-commit/pre-commit-hooks at v4.6.0 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: pre-commit hooks from https://github.com/Yelp/detect-secrets at v1.5.0 (contributor tooling: runs only after pre-commit install) · uses the network
  • .pre-commit-config.yaml: bash -c 'PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ./venv/bin/pytest tests/ --ignore=tests/benchmarks --ignore=tests/test_integration.py -x -q'
  • .pre-commit-config.yaml: bash -c 'command -v coderabbit >/dev/null 2>&1 || { echo "coderabbit CLI not installed, skipping"; exit 0; }; coderabbit review --type committed --plain'

Agent instructions that run or fetch something (39)

  • AGENTS.md: `make install`: Create `.venv` (and symlink `venv -> .venv`) and install dev deps.
  • AGENTS.md: `make dev`: Start local stack via Docker (FalkorDB, Qdrant, API).
  • AGENTS.md: `make test`: Run unit tests (fast, no services).
  • AGENTS.md: `make test-integration`: Start Docker and run full integration tests.
  • AGENTS.md: `make fmt` / `make lint`: Format with Black/Isort and lint with Flake8.
  • AGENTS.md: `make bench-eval BENCH=locomo-mini`: Run snapshot-based benchmark (~2 min).
  • AGENTS.md: `make deploy` / `make status`: Deploy/check Railway.
  • AGENTS.md: Quick health: `curl :8001/health`. · uses the network
  • AGENTS.md: Run `pre-commit install` and `make fmt && make lint` before committing.
  • AGENTS.md: Unit tests: `make test`.
  • AGENTS.md: Integration: `make test-integration` (requires Docker).
  • AGENTS.md: | Tier | Benchmark | Command | Runtime | Cost | When to use | |------|-----------|---------|---------|------|-------------| | 0 | Unit tests | `make test` | 30s | free | Every change | | 1 | LoCoMo-mini (2 convos, 304 Qs) | `make bench-eval BENCH=locomo-mini` | 2-3 min | free / ~$0.20 …[+355 chars]
  • AGENTS.md: `make bench-eval BENCH=locomo-mini CONFIG=baseline` — eval from snapshot (~2 min).
  • AGENTS.md: `make bench-compare BENCH=locomo CONFIG=<name> BASELINE=baseline` — A/B compare two configs.
  • AGENTS.md: `make bench-compare-branch BRANCH=<branch>` — compare a branch against baseline.
  • AGENTS.md: `make bench-ingest BENCH=locomo` — ingest + snapshot (run once per embedding change).
  • AGENTS.md: `make bench-health` — recall health check (score distribution, entity quality, latency).
  • AGENTS.md: Run `make bench-eval BENCH=locomo-mini` on `main` to confirm the current baseline.
  • AGENTS.md: Run the same eval on the branch.
  • AGENTS.md: Promote to `make bench-eval BENCH=locomo` (full) before merge.
  • AGENTS.md: `benchmarks/snapshots/` — Qdrant/FalkorDB snapshot data (gitignored, regenerate with `make bench-ingest`).
  • AGENTS.md: `benchmarks/results/` — per-run result JSONs (gitignored).
  • AGENTS.md: release-please and GHCR `:stable` then run on `main`.
  • CLAUDE.md: `GET /consolidate/status` - Check consolidation scheduler status and last run times
  • CLAUDE.md: Adds short summaries, timestamps (`enriched_at`), and per-run metrics under `metadata.enrichment`.
  • CLAUDE.md: # Run tests
  • CLAUDE.md: make test-integration # Starts services and runs integration tests
  • CLAUDE.md: make test-live # Same as above via Makefile
  • CLAUDE.md: JIT_ENRICHMENT_ENABLED=true # Run entity/summary extraction inline on recall for unenriched memories
  • CLAUDE.md: Install spaCy locally to improve entity extraction:
  • CLAUDE.md: pip install spacy
  • CLAUDE.md: python -m spacy download en_core_web_sm
  • CLAUDE.md: **Local Development** - Make changes and test with `make dev`
  • CLAUDE.md: **Unit Tests** - Verify with `make test`
  • CLAUDE.md: **Integration Tests** - Validate with `make test-integration`
  • CLAUDE.md: **Deploy to Railway** - Push changes with `make deploy`
  • CLAUDE.md: **Live Validation** - Test deployed instance with `make test-live`
  • CLAUDE.md: **Benchmarking** - Validate performance with `make test-locomo-live`
  • CLAUDE.md: # Run integration tests against Railway

Install scripts (1)

  • Makefile (make install): echo "🔧 Setting up development environment..."; bash scripts/bootstrap_dev.sh; echo "✅ Virtual environment ready!"; echo "💡 Run 'source .venv/bin/activate' to activate"
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:9)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:16)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:23)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:30)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:38)
  • Medium risk: runs-git-hook-remote-exec (.pre-commit-config.yaml:50)
  • Medium risk: runs-instruction-instruction-network (AGENTS.md:23)
  • Low risk: network-instructions (.pre-commit-config.yaml:2)
  • Low risk: network-instructions (CLAUDE.md:299)
  • Low risk: network-instructions (Makefile:91)
  • Low risk: scripts-present (scripts/bootstrap_dev.sh)

Attribution and licence

First committed by
GitHub avatar of jack-arturojack-arturo
Publisher
Very Good Plugins (Community)
Source
verygoodplugins/automem · commit 1a7ba1a
Licence
MIT License (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
jack-arturo, mikemikimike, zackkatz, dexhunter

AutoGineer is not affiliated with or endorsed by jack-arturo or Very Good Plugins.

Install from source

249 of its files are not served here, so there is no ZIP. verygoodplugins/automem at 1a7ba1a