Skip to main content
Glama

๐ŸŽฏ 97.8% R@5

โšก ~14ms p50

๐Ÿ›  33 Tools

๐Ÿ”’ 100% Local

LongMemEval-S, 500q

Full recall pipeline

Complete memory toolkit

No cloud required


๐Ÿ’ก The Problem

Every AI tool starts from zero. Every session. Every tool.

- You: "Don't use 'any' in TypeScript"     โ†’ told Claude 3 times. Copilot still doesn't know.
- You: "We chose PostgreSQL over MongoDB"   โ†’ explained in Cursor. Claude has no idea.
+ With amem: tell it once, every AI tool remembers โ€” forever.
You (in Claude Code):  "Don't use any type in TypeScript"
  โ””โ”€ amem stores this as a correction (priority 1.0, confidence 100%)

You (switch to Copilot): starts coding
  โ””โ”€ Copilot already knows โ€” amem feeds it the same correction

You (open Cursor): "What do you remember about TypeScript?"
  โ””โ”€ Instantly recalls: "Don't use any type" + all related preferences

No cloud. No API keys. One SQLite file. Everything stays on your machine.


Related MCP server: agent-mem0

๐Ÿš€ Quick Start

Claude Code (recommended)

/plugin marketplace add amanasmuei/amem
/plugin install amem

GitHub Copilot CLI

copilot plugin marketplace add amanasmuei/amem
copilot plugin install amem
npm install -g @aman_asmuei/amem
amem-cli init      # Detects & configures all installed AI tools
amem-cli rules     # Generates extraction rules for proactive memory use

Or add to your MCP config manually:

{
  "mcpServers": {
    "amem": {
      "command": "npx",
      "args": ["-y", "@aman_asmuei/amem"]
    }
  }
}

Verify it works:

amem-cli stats     # Should show "0 memories" initially

๐Ÿ’ฌ Tell your AI: "Remember: always use strict TypeScript, never use any type"

๐Ÿ”„ Start a new session: "What do you remember about TypeScript?" โ€” it recalls instantly.


๐Ÿงฌ Powered by amem-core

amem is the MCP server. The retrieval engine lives in @aman_asmuei/amem-core.

     Claude Code / Copilot / Cursor / any MCP client
                        โ”‚
                        โ”‚ MCP (stdio)
                        โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  @aman_asmuei/amem  (this pkg)   โ”‚
        โ”‚  33 Tools ยท 7 Resources ยท 2 Prompts
        โ”‚  CLI ยท Hooks ยท Dashboard         โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚ imports
                        โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚  @aman_asmuei/amem-core          โ”‚
        โ”‚  Embeddings ยท HNSW ยท Recall      โ”‚
        โ”‚  Knowledge Graph ยท Reflection    โ”‚
        โ”‚  97.8% R@5 on LongMemEval-S      โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚  SQLite + WAL      โ”‚
              โ”‚  ~/.amem/memory.db โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Package

Role

Install

@aman_asmuei/amem (this)

MCP server + CLI + hooks

npm i -g @aman_asmuei/amem

@aman_asmuei/amem-core

Pure TS library, zero MCP deps

npm i @aman_asmuei/amem-core

The same engine powers amem (MCP server), aman-agent (CLI), aman-tg (Telegram bot), and any Node app you give memory to. Retrieval improvements ship via amem-core. MCP-tool changes ship via amem. They version independently.

The 97.8% R@5 headline is the engine quality from amem-core (LongMemEval-S, session-level, 500 questions, zero API calls) โ€” exactly what you get whether you call it through MCP or import the library directly.


โš™๏ธ How It Works

amem captures knowledge in three layers โ€” from fully automatic to fully manual:

Layer

How

What it does

Automatic

Lifecycle hooks

Captures tool observations, auto-extracts corrections/decisions/patterns at session end

AI-driven

Extraction rules

Your AI proactively calls memory_store when you correct it, make decisions, or express preferences

Manual

Natural language

"Remember: we use PostgreSQL" or "Forget the Redis memory"

Memory Types

Priority

Type

Example

1.0

correction

"Don't mock the DB in integration tests"

0.85

decision

"Chose Postgres over Mongo for ACID"

0.7

pattern

"Prefers early returns over nesting"

0.7

preference

"Uses pnpm, not npm"

0.5

topology

"Auth module lives in src/auth/"

0.4

fact

"API launched January 2025"

Corrections always surface first โ€” they are your AI's hard constraints.

Memory Tiers

Tier

Behavior

Core

Always injected at session start (~500 tokens). Your most critical corrections.

Working

Session-scoped, auto-surfaced for current task.

Archival

Default. Searchable but not auto-injected.

Temporal Validity

Memories aren't forever. When facts change:

  • Old memories get expired (not deleted) โ€” preserved for "what was true in March?"

  • Contradictions are auto-detected ๏ฟฝ๏ฟฝ๏ฟฝ storing a new decision auto-expires the old one

  • Query any point in time with memory_since

Your memory doesn't just store โ€” it learns from its own structure. Call memory_reflect to trigger the reflection engine:

memory_reflect โ†’ Analyzes your entire memory graph
  โ”‚
  โ”œโ”€ Clusters related memories (HNSW neighbor graph)
  โ”œโ”€ Detects contradictions (negation pairs, numerical, low-overlap)
  โ”œโ”€ Identifies synthesis candidates
  โ”œโ”€ Surfaces knowledge gaps (topics with sparse recall)
  โ””โ”€ Returns a structured report with suggested actions

The evolution loop:

  1. Reflect โ€” memory_reflect clusters your memories and finds patterns

  2. Synthesize โ€” AI merges related clusters into higher-order principles via memory_store

  3. Link โ€” memory_relate connects syntheses to source memories (tracked via synthesis lineage)

  4. Repeat โ€” each cycle, the graph becomes more coherent and abstract

The system auto-nudges when reflection is due (>7 days or >50 new memories since last run).

# Memory Reflection Report
Analyzed 127 memories in 12ms
Health Score: 68/100

## Stats
- Clusters: 8 (avg size: 4.2)
- Clustered: 34 | Orphans: 93
- Contradictions: 2
- Synthesis candidates: 3
- Knowledge gaps: 4

## Contradictions Found
โš  Opposing language detected (23d apart, 87% similar)
  A: a1b2c3d4 "Always use semicolons in JavaScript..."
  B: e5f6g7h8 "Never use semicolons in JavaScript..."
  โ†’ Expire older memory a1b2c3d4 โ€” newer supersedes it

## Synthesis Candidates
### cluster-0 (4 patterns)
  "These 4 related memories form a cluster about 'typescript, types':
  [patterns]:
    - 'Always use strict TypeScript types'
    - 'Prefer strict null checks'
    - 'Use unknown instead of any'
    - 'Enable strictNullChecks in tsconfig'

  Synthesize into a higher-order principle..."

## Knowledge Gaps
- "kubernetes deployment" โ€” asked 3x, avg 25% confidence
- "database migration strategy" โ€” asked 2x, avg 0% confidence

๐Ÿ“ˆ Benchmarks

Recall Accuracy (LongMemEval)

All numbers from amem-core v0.5.1 โ€” the retrieval engine powering this MCP server. Zero API calls, all local, fully reproducible.

LongMemEval-S (session-level) โ€” headline metric

Metric

Score

R@1

95.0%

R@3

97.0%

R@5

๐Ÿ† 97.8%

R@10

99.0%

500 questions ยท CPU only ยท zero API calls

LongMemEval Oracle (turn-level)

Metric

Score

R@1

66.2%

R@3

90.8%

R@5

94.6%

R@10

97.5%

479 scoreable questions ยท 301s runtime ยท Node 22

Pipeline: local bge-small-en-v1.5 bi-encoder + ms-marco-MiniLM-L-6-v2 cross-encoder (int8, batched, default-on). See amem-core benchmarks for full per-type breakdowns, pipeline evolution, and honest notes.

Why this matters for the "rewrite it in Rust" question. The 10.3ms rerank figure above reflects a ~30% speedup over the per-pair implementation it replaced โ€” achieved with ~20 lines of batching plus int8 quantization, no native rewrite. The hot paths were already efficient; the remaining wins came from using them more carefully. We stay on TypeScript.

Search Latency

Full recall pipeline (v0.5.1+)

Stage

p50

Share

Embed (bi-encoder)

3.0ms

22%

Retrieve (HNSW + multi-strategy)

0.1ms

1%

Rerank (int8 cross-encoder)

10.3ms

74%

Total

~14ms

100%

HNSW index only (vector search)

Memories

HNSW

Brute-force

Speedup

100

0.05ms

0.10ms

2x

1,000

0.06ms

0.50ms

8x

5,000

0.08ms

2.44ms

30x

10,000

0.08ms

5.35ms

67x

Measured: 100 searches averaged, 384-dim embeddings, top-10 results.

Sub-0.1ms at any scale โ€” effectively O(log n). HNSW is an optional dependency; brute-force is used as fallback when unavailable.


๐Ÿ› ๏ธ Tools Reference

Core Memory (7 tools)

Tool

Description

memory_store

Store a memory with type, tags, confidence. Auto-redacts private content, auto-expires contradictions.

memory_recall

Semantic search โ€” compact mode by default (~10x token savings). Use memory_detail for full content.

memory_detail

Retrieve full content by ID after compact recall.

memory_context

Load all relevant context for a topic, organized by type with token budgeting.

memory_extract

Batch-save multiple memories from conversation.

memory_forget

Delete by ID or query (with confirmation).

memory_inject

Surface corrections + decisions + graph neighbors before coding starts.

Precision & History (5 tools)

Tool

Description

memory_patch

Surgical field-level edit with auto-snapshot.

memory_versions

View full edit history or restore any version.

memory_search

Exact full-text search via FTS5 with compact mode.

memory_since

Temporal query with natural language ranges (7d, 2w, 1h).

memory_relate

Build a typed knowledge graph between memories.

Advanced (6 tools)

Tool

Description

memory_multi_recall

Multi-strategy search with compact mode: semantic + FTS5 + graph + temporal.

memory_tier

Move memories between tiers: core / working / archival.

memory_expire

Mark as no longer valid โ€” preserved for history, excluded from recall.

memory_summarize

Store structured session summary with decisions, corrections, metrics.

memory_history

View past session summaries.

memory_reflect

Self-evolving reflection engine โ€” clusters memories, detects contradictions, identifies synthesis candidates, surfaces knowledge gaps.

Admin & Sync (4 tools)

Tool

Description

memory_doctor

Run read-only health diagnostics on the amem database.

memory_repair

Perform safe, targeted repairs on the amem database.

memory_config

Get or set amem configuration with safety guardrails.

memory_sync

Import or export memories between amem and other systems (Claude auto-memory, Copilot instructions).

Reminders (4 tools)

Tool

Description

reminder_set

Create reminder with optional deadline and scope.

reminder_list

List active (or all) reminders, filterable by scope.

reminder_check

Show overdue, today, and upcoming (7 days).

reminder_complete

Mark as done (supports partial ID).

Log & Maintenance (7 tools)

Tool

Description

memory_log

Append raw conversation turns (lossless, append-only).

memory_log_recall

Search or replay log by session, keyword, or recency.

memory_log_cleanup

Prune old entries with configurable retention.

memory_stats

Counts, type breakdown, confidence distribution.

memory_export

Export as Markdown or JSON.

memory_import

Bulk import from JSON with automatic dedup.

memory_consolidate

Merge duplicates, prune stale, promote frequent, decay idle.


๐Ÿ“– Usage Guide

Storing Memories

Natural language (easiest)

"Remember: we use PostgreSQL, not MongoDB"
"Store a correction: never use console.log in production"
"Note that the auth module is in src/auth/"

Explicit tool calls

memory_store({
  content: "Never use 'any' โ€” define proper interfaces",
  type: "correction",
  tags: ["typescript"],
  confidence: 1.0
})

Recalling Memories

// Step 1: Compact index โ€” ~50-100 tokens (default)
memory_recall({ query: "auth decisions", limit: 5 })
// -> a1b2c3d4 [decision] Auth service uses JWT tokens... (92%)
// -> e5f6g7h8 [correction] Never store tokens in localStorage... (100%)

// Step 2: Full details only for what you need
memory_detail({ ids: ["a1b2c3d4", "e5f6g7h8"] })
// Multi-strategy: semantic + FTS5 + graph + temporal
memory_multi_recall({
  query: "authentication architecture",
  limit: 10,
  weights: { semantic: 0.4, fts: 0.3, graph: 0.15, temporal: 0.15 }
})

// Exact keyword search (FTS5 syntax)
memory_search({ query: "OAuth PKCE" })
memory_search({ query: '"event sourcing"' })     // phrase match
memory_search({ query: "auth* NOT legacy" })      // boolean

Managing Memories

// Surgical edit with auto-snapshot for rollback
memory_patch({ id: "a1b2c3d4", field: "content", value: "Updated text", reason: "clarified" })

// View edit history / restore
memory_versions({ memory_id: "a1b2c3d4" })

// Expire (preserve for history, exclude from recall)
memory_expire({ id: "a1b2c3d4", reason: "Migrated to GraphQL" })

// Promote to core tier (always loaded at session start)
memory_tier({ id: "a1b2c3d4", tier: "core" })

// Link related memories (graph builds itself, but you can add manual links)
memory_relate({ action: "relate", from_id: "abc", to_id: "xyz", relation_type: "supports" })

Relation types: supports, contradicts, depends_on, supersedes, related_to, caused_by, implements โ€” or define your own.

Reminders

reminder_set({ content: "Review PR #42", due_at: 1743033600000, scope: "global" })

reminder_check({})
// -> [OVERDUE] Review PR #42
// -> [TODAY] Deploy auth service
// -> [upcoming] Write quarterly report

reminder_complete({ id: "a1b2c3d4" })

Privacy

// Private blocks stripped before storage
memory_store({
  content: "DB password is <private>hunter2</private>, connect to prod at db.example.com",
  type: "topology", tags: ["database"]
})
// Stored: "DB password is [REDACTED], connect to prod at db.example.com"

// API keys, tokens, passwords auto-redacted by pattern matching
// Configure patterns in ~/.amem/config.json

โš”๏ธ Honest Comparison: amem vs graphify

graphify is the most common "what about X?" when people find amem. They solve fundamentally different problems and are genuinely complementary.

What each tool does

amem

graphify

One-liner

Persistent memory across AI sessions

Codebase โ†’ knowledge graph

Core question

"What has my AI learned about me?"

"What does this codebase look like?"

Input

Natural language (corrections, decisions, preferences)

Files (code, docs, PDFs, images, video)

Output

Recalled memories ranked by relevance

Structural graph + report + interactive HTML

Persistence

Always โ€” memory survives across sessions and tools

Snapshot โ€” graph.json persists, but doesn't learn over time

When it runs

Continuously, every session

On-demand (/graphify .) or on commit via git hook

Technical comparison

amem

graphify

Runtime

TypeScript / Node (โ‰ฅ18)

Python (โ‰ฅ3.10)

Protocol

MCP server (33 tools, 7 resources)

AI skill (slash command) + optional MCP server

Storage

SQLite + FTS5 + WAL

NetworkX graph โ†’ JSON file

Search

Semantic embeddings + FTS5 + graph + reranking

Graph traversal (BFS/DFS) + node lookup

Embeddings

Local bge-small-en-v1.5 (384-dim)

None โ€” uses graph topology, not vector similarity

Code understanding

None โ€” stores what you tell it

Deep โ€” tree-sitter AST for 25 languages

Multimodal

Text only

Code, docs, PDFs, images, video, audio

LLM required

No (all local)

Yes for docs/images (code is LLM-free via tree-sitter)

Benchmark

97.8% R@5 on LongMemEval-S

71.5x token reduction vs raw file reading

AI tool support

Claude Code, Copilot, Cursor, any MCP client

Claude Code, Codex, Copilot, Cursor, Gemini, Aider, Kiro, +10 more

Where each wins

amem wins at:

  • Remembering your preferences, corrections, and decisions across projects and tools

  • Semantic recall โ€” finding the right memory from a vague query (97.8% R@5)

  • Temporal intelligence โ€” tracking what was true when, auto-expiring contradictions

  • Self-evolution โ€” reflection engine clusters, detects contradictions, identifies gaps

  • Zero LLM dependency โ€” everything runs locally, no API calls

graphify wins at:

  • Understanding code structure โ€” call graphs, imports, class hierarchies, cross-file relationships

  • Multimodal ingestion โ€” drop in code, papers, screenshots, videos, it graphs them all

  • Token efficiency โ€” 71.5x compression means your AI reads structure, not raw files

  • Breadth of language support โ€” 25 programming languages via tree-sitter AST

  • Breadth of AI tool support โ€” 15+ platforms with dedicated install commands

Honest takeaways

  1. They don't compete. amem remembers your knowledge (decisions, corrections, preferences). graphify maps the codebase's structure (call graphs, dependencies, architecture). Different data, different access patterns.

  2. Use both if you want. Run graphify . to get a structural map of your project. Use amem to remember "we chose this architecture because X." The graph tells your AI what exists. The memory tells it why things are that way.

  3. graphify has broader platform coverage (15+ AI tools). amem has deeper integration where it works (MCP protocol with 33 tools, structured resources, prompts).

  4. graphify needs an LLM for non-code files. amem is fully local โ€” no API calls, no model inference beyond the local embedding model.

  5. The real choice depends on your pain point. If your AI keeps forgetting your preferences and decisions โ†’ amem. If your AI can't navigate your codebase efficiently โ†’ graphify. If both โ†’ use both.


๐ŸŒ Platform Compatibility

Feature

Claude Code

GitHub Copilot CLI

Cursor / Windsurf / Other

One-command plugin install

Yes

Yes

--

33 MCP tools

Yes

Yes

Yes

AI skills

14

7

--

Auto-capture hooks

Yes

Yes

--

Session auto-summarize

Yes

Yes

--

Auto-memory sync

Yes

--

--

CLI setup (amem-cli init)

Yes

Yes

Yes

Claude Code has the deepest integration (plugin + hooks + auto-memory sync). Copilot CLI is a close second. Other MCP clients get the full 33-tool server via manual config.

AI Skills

What you say

Skill

Claude Code

Copilot CLI

"Remember never use any type"

remember

Yes

Yes

"What do you remember about auth?"

recall

Yes

Yes

"Load context for this task"

context

Yes

Yes

"Show memory stats"

stats

Yes

Yes

"Run memory doctor"

doctor

Yes

Yes

"Export my memories"

export

Yes

Yes

"List all corrections"

list

Yes

Yes

"Sync my Claude memory"

sync

Yes

--

"Open the memory dashboard"

dashboard

Yes

--

"Install hooks"

hooks

Yes

--


๐Ÿ”„ Working with Claude Code Auto-Memory

amem complements Claude's built-in auto-memory โ€” it doesn't replace it.

Claude auto-memory

amem

Capture

Automatic, zero config

Typed with confidence scores

Storage

Single markdown file

SQLite with search, graph, temporal

Recall

Entire file loaded every session

Only relevant memories surfaced

History

Overwritten on update

Versioned, temporal validity

Search

None

Semantic + FTS5 + graph + reranking

Recommended: Keep both enabled. Run amem-cli sync to import Claude's memories into amem for unified, structured access.

amem-cli sync              # Import all projects
amem-cli sync --dry-run    # Preview what would be imported
amem-cli sync --project myapp  # Import specific project

Claude type

amem type

Confidence

feedback

correction

1.0

project

decision

0.85

user

preference

0.8

reference

topology

0.7

Export amem memories to .github/copilot-instructions.md so Copilot reads them as persistent context:

amem-cli sync --to copilot              # Export to current project
amem-cli sync --to copilot --dry-run    # Preview without writing
amem-cli sync --to copilot --project /path/to/repo

This generates structured markdown grouped by priority:

  1. Corrections (MUST follow) โ€” hard constraints

  2. Decisions โ€” architectural choices

  3. Preferences โ€” user preferences

  4. Patterns โ€” coding conventions

  5. Context โ€” topology + facts

The amem section is wrapped in <!-- amem:start/end --> markers โ€” existing non-amem content in the file is preserved.

Cross-tool sync: Decisions made in Claude sessions automatically inform Copilot:

Claude Code โ†’ amem sync โ†’ amem DB โ†’ amem sync --to copilot โ†’ copilot-instructions.md

๐Ÿ“Š Dashboard & Knowledge Graph

amem-cli dashboard              # Opens at localhost:3333
amem-cli dashboard --port=8080  # Custom port

Full-featured web dashboard with:

  • ๐Ÿ” Memory browser โ€” search, filter by type/tier/source, inline actions (promote, demote, expire)

  • ๐Ÿ•ธ๏ธ Interactive knowledge graph โ€” zoom, pan, click-to-focus with neighborhood highlighting, detail panel, search, directional edges

  • ๐Ÿ“ˆ Analytics โ€” confidence distribution, type breakdown, session timeline

  • โฐ Reminders โ€” view and manage cross-session tasks

  • ๐Ÿ“‹ Copilot Preview โ€” see what would be exported to copilot-instructions.md


๐Ÿ’ป CLI Reference

# Setup
amem-cli init                          # Auto-configure AI tools
amem-cli rules                         # Generate extraction rules
amem-cli hooks                         # Install hooks for Claude Code
amem-cli hooks --target copilot        # Install hooks for GitHub Copilot CLI
amem-cli hooks --uninstall             # Remove hooks
amem-cli sync                          # Import Claude auto-memory โ†’ amem
amem-cli sync --to copilot             # Export amem โ†’ copilot-instructions.md
amem-cli doctor                        # Health diagnostics
amem-cli repair                        # Repair corrupted database from backups

# Dashboard
amem-cli dashboard                     # Web dashboard (localhost:3333)

# Memory operations
amem-cli recall "authentication"       # Semantic search
amem-cli stats                         # Statistics
amem-cli list --type correction        # List by type
amem-cli export --file memories.md     # Export to file
amem-cli forget abc12345               # Delete by short ID
amem-cli reset --confirm               # Wipe all data

๐Ÿ— Architecture

                        Your AI Tool
           Claude Code / Copilot CLI / any MCP client
                    โ”‚                โ”‚
                    โ”‚ MCP (stdio)    โ”‚ Lifecycle Hooks
                    โ–ผ                โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚   @aman_asmuei/amem             โ”‚  โ† this package
          โ”‚                                 โ”‚
          โ”‚  33 Tools ยท 7 Resources ยท 2 Prompts
          โ”‚  Slash commands ยท CLI ยท Hooks   โ”‚
          โ”‚  Config: ~/.amem/config.json    โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚ imports
                           โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚   @aman_asmuei/amem-core        โ”‚  โ† the engine
          โ”‚                                 โ”‚
          โ”‚  Multi-Strategy Retrieval       โ”‚
          โ”‚  [HNSW] + [FTS5] + [Graph] + [Temporal]
          โ”‚       + query expansion         โ”‚
          โ”‚       + cross-encoder reranker   โ”‚
          โ”‚                                 โ”‚
          โ”‚  Self-Evolving Reflection       โ”‚
          โ”‚  [Clustering] + [Contradictions]โ”‚
          โ”‚  + [Synthesis] + [Gap Detection]โ”‚
          โ”‚                                 โ”‚
          โ”‚  Embeddings: bge-small-en-v1.5  โ”‚
          โ”‚  Reranker: ms-marco-MiniLM int8 โ”‚
          โ”‚  97.8% R@5 on LongMemEval-S     โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚   SQLite + WAL + FTS5           โ”‚
          โ”‚   ~/.amem/memory.db             โ”‚
          โ”‚                                 โ”‚
          โ”‚   memories       (tiered)       โ”‚
          โ”‚   conversation_log (raw)        โ”‚
          โ”‚   memory_versions (history)     โ”‚
          โ”‚   memory_relations (graph)      โ”‚
          โ”‚   synthesis_lineage             โ”‚
          โ”‚   knowledge_gaps                โ”‚
          โ”‚   session_summaries             โ”‚
          โ”‚   reminders                     โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The amem MCP server is a thin wrapper around amem-core. The retrieval engine, embeddings, knowledge graph, reflection โ€” all live in amem-core and version independently. Bug in MCP wiring? Republish amem. Recall improvement? Republish amem-core. No coupling.

Ranking Formula

score = relevance x 0.45 + recency x 0.2 + confidence x 0.2 + importance x 0.15

Factor

How it works

Relevance

Cosine similarity via HNSW index; query-expanded keyword fallback

Recency

Exponential decay (0.995^hours)

Confidence

Reinforced by repeated confirmation (0-1)

Importance

Type-based: corrections 1.0 ... facts 0.4

Additive scoring ensures no single low factor kills the ranking.


โš™๏ธ Configuration

Variable

Default

Description

AMEM_DIR

~/.amem

Storage directory

AMEM_DB

~/.amem/memory.db

Database path

AMEM_PROJECT

(auto from git)

Project scope override

Created automatically with defaults:

{
  "retrieval": {
    "semanticWeight": 0.4,
    "ftsWeight": 0.3,
    "graphWeight": 0.15,
    "temporalWeight": 0.15,
    "rerankerEnabled": true
  },
  "privacy": {
    "enablePrivateTags": true,
    "redactPatterns": ["..."]
  },
  "tiers": {
    "coreMaxTokens": 500,
    "workingMaxTokens": 2000
  },
  "hooks": {
    "enabled": true,
    "captureToolUse": true,
    "captureSessionEnd": true
  }
}

v0.23.0 โ€” Interactive Knowledge Graph Dashboard

Full-width graph explorer with zoom/pan, click-to-focus neighborhood highlighting, detail panel with relation navigation, search & filter, directional edges, force-directed layout. Admin tools (doctor, repair, config, sync). 255 tests across 18 suites.

v0.19.0 โ€” Self-Evolving Memory Loop

Reflection engine with HNSW-based clustering, 3-layer contradiction detection (negation + numerical + low-overlap), synthesis candidates with lineage tracking, knowledge gap detection, utility scoring, auto-trigger nudge in memory_inject. New DB tables: synthesis_lineage, knowledge_gaps, reflection_meta. Migration v5.

v0.18.0 โ€” Progressive Disclosure & Scale

HNSW vector index (67x faster at 10k), compact mode default on recall/search, DB repair CLI, concurrent access safety, heuristic conversation extractor, session-end auto-extraction.

v0.13.0 โ€” World-Class Recall

bge-small-en-v1.5 embeddings, additive scoring, query expansion, auto-relate knowledge graph, graph-aware injection, amem doctor, CI benchmarks.

v0.9.x โ€” Temporal Intelligence

Temporal validity, auto-expire contradictions, multi-strategy retrieval, cross-encoder reranking, memory tiers, privacy tags, lifecycle hooks, session summaries, dashboard, config system.

v0.7.0 โ€” v0.8.0

Import/export, confidence decay, embedding cache, multi-process safety, auto-configure CLI, dashboard.

v0.1.0 โ€” v0.5.x

Core store/recall, local embeddings, SQLite + WAL, consolidation, project scoping, reminders, conversation log, knowledge graph, FTS5, progressive disclosure.


๐Ÿงฐ Tech Stack

Layer

Technology

Protocol

MCP SDK ^1.25

Language

TypeScript 5.6+, strict mode

Database

SQLite + WAL + FTS5

Embeddings

HuggingFace bge-small-en-v1.5 (local, 80MB) + HNSW vector index

Reranking

ms-marco-MiniLM-L-6-v2 (default-on, int8, batched, local)

Validation

Zod 3.25+ with .strict() schemas

Testing

Vitest โ€” 281 tests across 19 suites + recall benchmarks

CI/CD

GitHub Actions, npm publish on release


๐Ÿค Contributing

git clone https://github.com/amanasmuei/amem.git
cd amem && npm install
npm run build   # zero TS errors
npm test        # 281 tests pass

PRs must pass CI before merge. See Issues for open tasks.


A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
1dRelease cycle
35Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    Provides persistent memory for AI coding assistants, storing and retrieving architectural decisions, patterns, and solutions across sessions using semantic search, while also offering git integration for commit messages and code expertise mapping.
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Provides persistent cross-session memory for Claude Code, enabling it to remember user preferences, decisions, and project context across new sessions.
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    Enables AI coding assistants to store and retrieve persistent long-term memory across sessions, remembering project preferences, build steps, and architecture decisions.
    4
    MIT

View all related MCP servers

Related MCP Connectors

  • Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).

  • Persistent memory for AI agents. Search, store, and recall across sessions.

  • Persistent memory for AI agents โ€” verbatim conversations, searchable by meaning.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amanasmuei/amem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server