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/MONITORING_AND_BACKUPS.md

AutoMem Monitoring & Backups

Complete guide to setting up automated health monitoring and backups for AutoMem on Railway.

For the current script inventory, safety classification, and exact CLI usage, see the scripts catalog.

Overview

AutoMem includes three layers of data protection:

  1. Persistent Volumes - Railway volumes for FalkorDB data

  2. Dual Storage - Data stored in both FalkorDB (graph) and Qdrant (vectors)

  3. Automated Backups - Scheduled exports to compressed JSON + optional S3 upload

flowchart TB
    subgraph layer1 [Layer 1: Persistent Volumes]
        RailwayVol[Railway Volume Snapshots<br/>Automatic every 24h<br/>One-click restore]
    end

    subgraph layer2 [Layer 2: Dual Storage]
        FalkorDB[(FalkorDB<br/>Graph Database<br/>Canonical record)]
        Qdrant[(Qdrant<br/>Vector Database<br/>Semantic search)]

        FalkorDB <-->|Redundancy| Qdrant
    end

    subgraph layer3 [Layer 3: Automated Backups]
        Script[Backup Scripts<br/>Compressed JSON]
        Local[Local Backups<br/>./backups/]
        S3[S3 Cloud Storage<br/>Cross-region]
        GitHub[GitHub Actions<br/>Free tier]

        Script --> Local
        Script --> S3
        GitHub --> Script
    end

    layer1 --> layer2
    layer2 --> layer3

    Recovery[Recovery Options]

    RailwayVol -.->|Quick restore| Recovery
    Qdrant -.->|Rebuild FalkorDB| Recovery
    Local -.->|Full restore| Recovery
    S3 -.->|Disaster recovery| Recovery

Health Monitoring

The health_monitor.py script continuously monitors system health and can automatically trigger recovery.

Quick Start

Option 1: Deploy as Railway Service (Recommended)

Create a new Railway service for continuous monitoring:

# In Railway dashboard
1. Create new service from GitHub repo
2. Set Dockerfile path: `scripts/Dockerfile.health-monitor` (included in this repository)
3. Configure environment variables (same as main service)
4. Deploy

Option 2: Run as Cron Job

# One-time health check (safe)
railway run --service automem python scripts/health_monitor.py --once

# Alert-only monitoring (no auto-recovery)
railway run --service automem python scripts/health_monitor.py --interval 300

# With Slack webhook alerts
railway run --service automem python scripts/health_monitor.py \
  --interval 300 \
  --webhook https://hooks.slack.com/services/YOUR/WEBHOOK/URL
Configuration

Set these environment variables on your monitoring service:

# Required (same as main service)
FALKORDB_HOST=falkordb.railway.internal
FALKORDB_PORT=6379
FALKORDB_PASSWORD=<your-password>
QDRANT_URL=<your-qdrant-url>
QDRANT_API_KEY=<your-qdrant-key>
AUTOMEM_API_URL=https://your-automem-deployment.up.railway.app

# Optional monitoring settings
HEALTH_MONITOR_DRIFT_THRESHOLD=5          # Warning at 5% drift
HEALTH_MONITOR_CRITICAL_THRESHOLD=50      # Critical at 50% drift
HEALTH_MONITOR_WEBHOOK=<slack-webhook>    # Alert webhook
Auto-Recovery (Use with Caution!)

Enable automatic recovery when data loss is detected:

python scripts/health_monitor.py \
  --auto-recover \
  --interval 300 \
  --critical-threshold 50

⚠️ Warning: Auto-recovery will automatically run the recovery script when critical drift is detected. Only enable this if you trust the system to self-heal.


Automated Backups

Railway Volume Backups (Built-in) ✅

Already configured! If you're using Railway, your FalkorDB service has automatic volume backups enabled.

Features:

  • ✅ Automatic snapshots (default: every 24 hours)

  • ✅ One-click restore from Railway dashboard

  • ✅ Included with Railway Pro (no extra cost)

  • ✅ Instant volume snapshots

Access backups:

  1. Railway Dashboard → falkordb service

  2. Click "Backups" tab

  3. View backup history and schedule

  4. Click "Restore" to recover from any snapshot

Limitations:

  • Only backs up FalkorDB (not Qdrant)

  • Platform-locked (can't export/download)

  • Use for quick recovery; combine with script backups for full protection


Script-Based Backups

For portable backups that cover both databases, use the backup_automem.py script:

API Backup Export

When AutoMem itself has internal-network access to FalkorDB and Qdrant, operators can pull a full portable backup through the API without opening database proxies:

curl -H "X-Admin-Token: $ADMIN_API_TOKEN" \
  "$AUTOMEM_API_URL/backup" \
  -o snapshot.tar.gz

python scripts/restore_from_backup.py --backup-dir snapshot.tar.gz --force

GET /backup requires the admin token because it exports the full corpus. Add ?include=falkordb or ?include=qdrant to export only one store.

Migrate an Existing Qdrant Collection to On-Disk Storage

New AutoMem collections store vectors, the HNSW index, and payloads on disk by default. Existing collections retain their configuration, so migrate them deliberately during a maintenance window.

Warning: This operation deletes and recreates the configured Qdrant collection. Take and test a portable backup first; that backup is the rollback path.

  1. Quiesce writes before taking the backup. Put API clients, workers, and scheduled writers into maintenance/read-only mode, then keep writes stopped through the restore and validation. The API may remain available only to serve the backup export; point counts alone cannot detect concurrent updates or same-count changes.

  2. Record the current point count and create a recoverable Railway volume snapshot before touching the collection:

    curl -sS -H "api-key: $QDRANT_API_KEY" \
      "$QDRANT_URL/collections/$QDRANT_COLLECTION" | jq '.result.points_count'

    This runbook is for collections using Qdrant's default topology. Capture and review the existing collection configuration before continuing:

    curl -sS -H "api-key: $QDRANT_API_KEY" \
      "$QDRANT_URL/collections/$QDRANT_COLLECTION" \
      -o qdrant-before-on-disk-migration-config.json

    The restore preserves points and vector size, then applies the documented on-disk tuning; it does not preserve custom sharding, replication, write-consistency, quantization, or strict-mode settings. If this configuration has non-default settings, stop before the export and use an operator-specific migration that reapplies them during collection creation.

  3. Export a Qdrant-only portable backup from AutoMem:

    curl -H "X-Admin-Token: $ADMIN_API_TOKEN" \
      "$AUTOMEM_API_URL/backup?include=qdrant" \
      -o qdrant-before-on-disk-migration.tar.gz
  4. Dry-run the portable artifact and confirm its reported point count matches the value from step 2 before deleting the collection:

    python scripts/restore_from_backup.py \
      --backup-dir qdrant-before-on-disk-migration.tar.gz \
      --qdrant-only --dry-run --force

    If the counts differ, do not run the destructive restore. The portable export is incomplete; recover from the Railway volume snapshot instead of restoring the same artifact.

  5. Restore that verified backup to the intended Qdrant service with all on-disk settings enabled:

    QDRANT_RESTORE_VECTOR_ON_DISK=true \
    QDRANT_RESTORE_HNSW_ON_DISK=true \
    QDRANT_RESTORE_ON_DISK_PAYLOAD=true \
    python scripts/restore_from_backup.py \
      --backup-dir qdrant-before-on-disk-migration.tar.gz \
      --qdrant-only --force

    Ensure QDRANT_URL, QDRANT_API_KEY, and QDRANT_COLLECTION identify the production collection before running the command.

  6. Restart the AutoMem API while writes are still quiesced. With QDRANT_ENSURE_PAYLOAD_INDEXES=true (the default), startup recreates the tags, tag_prefixes, and type payload indexes that the collection restore does not preserve.

  7. Compare the restored point count with the value recorded in step 2 and run representative recall requests before declaring the migration complete. If validation fails, stop and restore the tested backup. Resume writers only after this validation succeeds.

  8. Leave the existing Railway volume size unchanged through a stable observation period. Resize it manually only after the restored collection is healthy and its disk usage is understood; AutoMem does not automate that infrastructure change.

Local Backups (Development)

The backup_automem.py script exports both FalkorDB and Qdrant to compressed JSON files:

# Basic backup to ./backups/
python scripts/backup_automem.py

# Backup with cleanup (keep last 7)
python scripts/backup_automem.py --cleanup --keep 7

# Custom backup directory
python scripts/backup_automem.py --backup-dir /mnt/backups
Cloud Backups (Production)

Upload backups to S3 for disaster recovery:

# Install AWS SDK
pip install boto3

# Configure AWS credentials (Railway secrets)
export AWS_ACCESS_KEY_ID=<your-key>
export AWS_SECRET_ACCESS_KEY=<your-secret>
export AWS_DEFAULT_REGION=us-east-1

# Backup with S3 upload
python scripts/backup_automem.py \
  --s3-bucket my-automem-backups \
  --cleanup --keep 7
Automated Script Backups

Recommended: GitHub Actions (Free)

GitHub Actions is the simplest way to automate backups - free and doesn't consume Railway resources.

Setup (5 minutes):

  1. Workflow file already exists: .github/workflows/backup.yml

  2. Enable TCP Proxy on FalkorDB (required for external access):

    ⚠️ Critical: GitHub Actions runners are external to Railway's network. They cannot use internal hostnames like falkordb.railway.internal. You must enable TCP Proxy for external connectivity.

    • Railway Dashboard → falkordb service

    • Settings → Networking → Enable TCP Proxy

    • Note the public endpoint: monorail.proxy.rlwy.net:12345 (example)

    flowchart LR
        subgraph railway [Railway Network]
            FalkorDB[(FalkorDB<br/>:6379)]
            TCPProxy[TCP Proxy<br/>monorail.proxy.rlwy.net:12345]
        end
    
        subgraph external [External]
            GHA[GitHub Actions]
            Local[Local Dev]
        end
    
        GHA -->|Public Internet| TCPProxy
        Local -->|Public Internet| TCPProxy
        TCPProxy -->|Internal| FalkorDB
  3. Add GitHub secrets:

    • Go to: GitHub repo → Settings → Secrets and variables → Actions

    • Add these secrets:

      FALKORDB_HOST         = monorail.proxy.rlwy.net   # TCP Proxy domain (NOT .railway.internal!)
      FALKORDB_PORT         = 12345                      # TCP Proxy port (NOT 6379!)
      FALKORDB_PASSWORD     = (from Railway FalkorDB service variables)
      QDRANT_URL            = (your Qdrant Cloud URL)
      QDRANT_API_KEY        = (your Qdrant Cloud API key)
    • Optional for S3: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION

    Where to find TCP Proxy details:

    • Railway Dashboard → falkordb service → Settings → Networking

    • Look for "TCP Proxy" section → shows RAILWAY_TCP_PROXY_DOMAIN and RAILWAY_TCP_PROXY_PORT

  4. Push and test:

    git push origin main
    • Go to Actions tab → "AutoMem Backup" → Run workflow

Runs every 6 hours automatically. Free tier: 2000 minutes/month.

Troubleshooting GitHub Actions Backup
Error: "Connection reset by peer" (error 104)

This means GitHub Actions can't connect to FalkorDB. Common causes:

  1. TCP Proxy not enabled: Enable it in Railway Dashboard → falkordb → Settings → Networking

  2. Wrong host/port in secrets: Must use TCP proxy endpoint, not internal hostname

  3. Firewall: Railway TCP Proxy should be accessible from anywhere, but check if your Railway plan has restrictions

Verify your setup:

# Test from your local machine (should work if TCP proxy is enabled)
redis-cli -h monorail.proxy.rlwy.net -p 12345 -a YOUR_PASSWORD ping
# Should return: PONG

# If redis-cli is not installed:
# macOS:   brew install redis
# Ubuntu:  sudo apt-get install redis-tools
# Windows: choco install redis

Debug checklist:

  • [ ] TCP Proxy is enabled on FalkorDB service

  • [ ] FALKORDB_HOST secret uses TCP proxy domain (e.g., monorail.proxy.rlwy.net)

  • [ ] FALKORDB_PORT secret uses TCP proxy port (e.g., 12345), NOT 6379

  • [ ] FALKORDB_PASSWORD matches the password in FalkorDB service variables


Railway-hosted backup schedules

AutoMem does not ship a standalone backup container recipe; the old documentation reference was stale. Use the included GitHub Actions backup workflow, or configure your platform's scheduler to run the documented backup_automem.py command with the required database credentials and off-site destination. The GitHub Actions workflow is the supported repository example.


Backup Restoration

flowchart TD
    Start{What data<br/>is lost?}

    Start -->|Only FalkorDB| QdrantCheck{Is Qdrant<br/>intact?}
    Start -->|Only Qdrant| BackupCheck1{Have recent<br/>backups?}
    Start -->|Both databases| BackupCheck2{Have recent<br/>backups?}
    Start -->|None just testing| NoAction[No action needed]

    QdrantCheck -->|Yes| RecoverQdrant[Salvage missing Memory nodes<br/>Prefer graph backup for lost edges]
    QdrantCheck -->|No| BackupCheck3{Have backups?}

    BackupCheck1 -->|Yes| RestoreQdrant[Restore Qdrant from backup<br/>Then rebuild FalkorDB<br/>⏱️ 15-30 min]
    BackupCheck1 -->|No| DataLoss1[⚠️ Partial data loss<br/>Rebuild from remaining data]

    BackupCheck2 -->|Yes Railway| RailwayRestore[Railway volume restore<br/>FalkorDB only<br/>⏱️ 5 min]
    BackupCheck2 -->|Yes S3/Local| FullRestore[Full restore from backups<br/>1. Restore Qdrant<br/>2. Rebuild FalkorDB<br/>⏱️ 20-40 min]
    BackupCheck2 -->|No| DataLoss2[⚠️ Complete data loss<br/>Start fresh]

    BackupCheck3 -->|Yes| FullRestore
    BackupCheck3 -->|No| DataLoss3[⚠️ Complete data loss<br/>Start fresh]

    RecoverQdrant --> Verify[Verify data integrity<br/>Check memory count]
    RestoreQdrant --> Verify
    RailwayRestore --> Verify
    FullRestore --> Verify
Salvage Missing Memories from Qdrant

If FalkorDB data is lost but Qdrant is intact:

railway run --service automem python scripts/recover_from_qdrant.py

This fetches and validates Qdrant payloads before inserting missing Memory nodes with their original IDs, JSON metadata, tag prefixes and temporal fields. It never clears the graph or overwrites existing nodes, so surviving entities and edges remain intact. Empty/invalid source data and partial write failures exit nonzero.

Qdrant does not contain graph relationships or Entity nodes. This is memory salvage, not a full graph restore. Re-enrichment can recreate some derived relationships; only a FalkorDB backup can restore original edges. When a graph backup exists, preview python scripts/restore_from_backup.py --dry-run --falkordb-only first, then follow that tool's restore instructions. The health monitor's opt-in --auto-recover uses salvage only for a graph memory deficit, and alerts without running it for a Qdrant deficit.

Restore from Backup Files

If both FalkorDB and Qdrant are lost, restore from backup:

# Preview the complete downloaded backup, including FalkorDB relationships
python scripts/restore_from_backup.py --backup-dir ./restore --dry-run

# Restore the selected backup after checking the preview and target stores
python scripts/restore_from_backup.py --backup-dir ./restore

If only a Qdrant backup is available, restore it with --qdrant-only, then use missing-memory salvage above. Original graph relationships cannot be recovered from that backup.


Monitoring Dashboards

Built-in Health Endpoint

Check system health via API:

curl https://your-automem-deployment.up.railway.app/health | jq

Response:

{
  "status": "healthy",
  "falkordb": "connected",
  "qdrant": "connected",
  "graph": "memories",
  "timestamp": "2025-10-05T14:45:00Z"
}
Railway Dashboard

Monitor your services:

  • Metrics: CPU, memory, network usage

  • Logs: Real-time log streaming

  • Deployments: Build history and status

  • Health Checks: Automated uptime monitoring

External Monitoring (Optional)

Set up external monitoring with:

  1. UptimeRobot - Free HTTP monitoring

    • Monitor: https://your-automem-deployment.up.railway.app/health

    • Alert when status != "healthy"

  2. Better Uptime - Advanced monitoring

    • HTTP checks + keyword monitoring

    • SMS/Slack/Email alerts

  3. Grafana Cloud - Full observability

    • Custom dashboards

    • Metrics aggregation

    • Log correlation


Backup Schedule Recommendations

For Personal Use
  • Health checks: Every 5 minutes (alert-only)

  • Backups: Every 24 hours, keep 7 days

  • Recovery: Manual trigger

For Team Use
  • Health checks: Every 2 minutes (with auto-recovery)

  • Backups: Every 6 hours, keep 14 days + S3

  • Recovery: Automatic on critical drift

For Production Use
  • Health checks: Every 30 seconds (with auto-recovery)

  • Backups: Every 1 hour, keep 30 days + S3 + cross-region replication

  • Recovery: Automatic with alerts


Alerting Integrations

Slack Webhook
# Get webhook URL from Slack App settings
# https://api.slack.com/messaging/webhooks

python scripts/health_monitor.py \
  --webhook https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXX
Discord Webhook
# Discord webhooks work the same as Slack
python scripts/health_monitor.py \
  --webhook https://discord.com/api/webhooks/123456789/abcdefg
Custom Webhook

The health monitor sends JSON payloads:

{
  "level": "critical",
  "title": "Data Loss Detected",
  "message": "FalkorDB has 52.3% drift from Qdrant",
  "details": {
    "drift_percent": 52.3,
    "falkordb_count": 420,
    "qdrant_count": 884
  },
  "timestamp": "2025-10-05T14:45:00Z",
  "system": "AutoMem Health Monitor"
}

Cost Estimates

Railway (Hobby Plan - $5/month)
  • ✅ Main API service

  • ✅ FalkorDB service with 1GB volume

  • ❌ Not enough resources for monitoring service

Railway (Pro Plan - $20/month)
  • ✅ Main API service (~$5)

  • ✅ FalkorDB service (~$10)

  • ✅ Health monitoring service (~$2)

  • ✅ Backup service (~$1)

  • Total: ~$18/month

Railway + External Services (Hybrid)
  • Railway Pro for main services (~$15)

  • GitHub Actions for backups (free)

  • UptimeRobot for monitoring (free)

  • Total: ~$15/month

AWS S3 Backup Costs
  • Storage: ~$0.023/GB/month (Standard)

  • Requests: ~$0.005/1000 PUTs

  • Example: 100MB backup every 6 hours = ~$0.30/month


Troubleshooting

Health Monitor Shows Drift

Problem: FalkorDB and Qdrant counts don't match

Causes:

  • In-flight writes during check (normal, <1% drift)

  • Failed writes to one store (>5% drift - warning)

  • Data loss event (>50% drift - critical)

Solution:

# Check health details
python scripts/health_monitor.py --once

# If FalkorDB has missing memories and Qdrant is known-good, salvage them
# Prefer a FalkorDB backup when relationships also need restoration
python scripts/recover_from_qdrant.py
Backup Failed

Problem: Backup script fails with connection error

Solution:

# Test connections
curl https://your-automem-deployment.up.railway.app/health

# Check credentials
echo $FALKORDB_PASSWORD
echo $QDRANT_API_KEY

# Try manual backup
python scripts/backup_automem.py
S3 Upload Failed

Problem: Backup created but S3 upload failed

Solution:

# Check AWS credentials
aws s3 ls s3://my-automem-backups/

# Test upload manually
aws s3 cp backups/falkordb/latest.json.gz s3://my-automem-backups/test/

# Check boto3 installation
python -c "import boto3; print(boto3.__version__)"

Next Steps

  • [ ] Set up health monitoring service on Railway

  • [ ] Configure Slack/Discord webhook alerts

  • [ ] Schedule automated backups (every 6 hours)

  • [ ] Test recovery process in staging environment

  • [ ] Set up S3 bucket with versioning enabled

  • [ ] Configure cross-region replication (optional)

Questions? Check the main Railway deployment guide: RAILWAY_DEPLOYMENT.md

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