Cross-agent memory over MCP: hybrid recall, knowledge graph, private/shared visibility, redaction.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Your AI agents remember everything. Automatically.
Lore is a cross-agent memory system that stores, connects, and retrieves knowledge across any AI agent β without code changes. Install a hook, and relevant memories appear in every prompt. No agent cooperation needed.
remember Β· recall Β· forget Β· list_memories Β· stats
Store and retrieve memories across any AI agent via MCP tools, REST API, or Python/TypeScript SDK. Semantic search with tier-based TTL, temporal decay, and automatic PII redaction.
graph_query Β· entity_map Β· related Β· extract_facts Β· list_facts Β· conflicts
Entities and relationships auto-extracted from memories. Hop-by-hop graph traversal surfaces connected knowledge that pure vector search misses. Atomic fact extraction with automatic conflict detection.
supersede Β· list_at_time Β· facts_at_time Β· timeline Β· provenance Β· supersession_chain Β· consolidate_memories
History without deletion. Memories and facts are corrected by superseding them, never deleting β every change appends to an auditable trail. Lore tracks two independent time axes (bi-temporal): valid-time (when a fact was true in the world) and system-time (when Lore learned it), so you can ask "what was canonical β or true about X β as of date Y?". list_at_time / facts_at_time answer as-of queries, timeline walks chronologically adjacent events, and provenance / supersession_chain expose the full correction lineage for a memory or fact.
Web UI at /ui/
Interactive D3 force-directed graph of your knowledge base. Entity detail panels, topic clusters, search, and filtering. Runs in the browser β no install required.
Auto-snapshot + auto-inject β zero agent cooperation
The Session Accumulator automatically captures conversation context and injects relevant session history into every prompt. Deterministic (no LLM needed). Works via hooks β the agent never knows Lore exists.
recent_activity
Session-aware summary of what happened recently across all projects. Gives agents continuity between conversations without manual context-passing.
topics Β· topic_detail
Auto-generated concept hubs that cluster related memories, entities, and facts around recurring themes. See everything Lore knows about a topic in one view.
export Β· snapshot Β· snapshot_list Β· save_snapshot
Full data export in JSON and Markdown formats. Obsidian-compatible output for browsing your knowledge graph in a PKM tool. Snapshots for backup and migration.
review_digest Β· review_connection Β· lore review list --sort risk
Review discovered knowledge graph connections with computed risk scores. Batch approve/reject with notes, full audit trail of decisions. Sort by risk, confidence, or age.
lore bootstrap
Single command that validates Python version, Postgres, pgvector, Docker, runs migrations, and verifies server health. Use --fix to auto-remediate missing dependencies.
lore setup claude-code Β· lore setup openclaw Β· lore setup cursor Β· lore setup codex
One-command hook installation for all major AI coding agents. Auto-retrieval injected into every prompt β no code changes needed. Includes --validate, --test-connection, and --dry-run flags.
lore slo create Β· lore slo status Β· GET /v1/slo/status
Define SLO targets for retrieval latency (p50/p95/p99) and hit rate. Background checker evaluates every 60s and fires webhook or email alerts on breach. Time-series API for charting.
lore profiles list Β· GET /v1/profiles Β· ?profile=coding
Named retrieval profiles stored in Postgres. Presets for coding (recency-biased), incident response (graph-heavy), and research (long-term). Select per-request or set as API key default.
lore policy create Β· lore restore-drill Β· GET /v1/policies/compliance
Declarative lifecycle policies with per-tier retention windows, cron-based snapshot schedules, and restore drills with timing metrics. Compliance dashboard across all policies.
lore workspace create Β· lore workspace switch Β· lore audit
Workspace isolation within orgs. Scoped API keys, member management with RBAC roles, and a full audit log of every action (memory.create, key.revoke, etc.).
lore plugin create Β· lore plugin list Β· lore plugin reload
Extend Lore with plugins discovered via Python entry_points. Five lifecycle hooks (on_remember, on_recall, on_enrich, on_extract, on_score), hot-reload, scaffold CLI, and test harness.
suggest Β· lore suggest --context "..." Β· GET /v1/recommendations
Surface relevant memories before explicit queries. Multi-signal scoring (context similarity, entity overlap, temporal patterns, access patterns) with human-readable explanations and a feedback loop.
GET /v1/analytics/retrieval Β· Prometheus metrics
Track hit rate, score distribution, memory utilization, and latency. Know whether memories are actually helping your agents.
Starts Postgres with pgvector and the Lore server on http://localhost:8765.
One line β no install β drops Lore into any MCP client (Claude Code, Cursor, VS Code, Codex, Claude Desktop):
Already installed (pip install lore-sdk[mcp])? Use "command": "lore-memory" (or lore mcp). Per-client guides are in Multi-Agent Setup below; lore integrate --platform <client> writes the config for you.
Option A: Auto-retrieval hook (recommended)
This installs a UserPromptSubmit hook that auto-injects relevant memories into every prompt.
Option B: MCP tools
Add to ~/.claude/settings.json:
Installs a message:preprocessed hook for auto-retrieval. Memories appear in context before every agent response.
Installs a beforeSubmitPrompt hook. Also add MCP config to .cursorrules:
Installs a beforePlan hook. Add MCP config:
Auto-retrieval works with any system that can make an HTTP call before sending a prompt:
| Tool | Description |
|---|---|
remember | Store a memory with type, tier, tags, metadata |
recall | Semantic search with temporal/graph-enhanced retrieval |
forget | Delete a memory by ID |
list_memories | List memories with filtering |
stats | Memory statistics (total, by type/tier) |
upvote_memory | Boost memory ranking |
downvote_memory | Lower memory ranking |
graph_query | Hop-by-hop knowledge graph traversal |
entity_map | List entities (optional D3 format) |
related | Find related memories/entities |
extract_facts | Extract (subject, predicate, object) triples |
list_facts | List active facts |
conflicts | List detected fact conflicts |
classify | Intent, domain, emotion classification |
enrich | LLM-powered metadata extraction |
consolidate | Merge duplicate/related memories |
ingest | Accept content from external sources |
github_sync | Sync GitHub repo data |
check_freshness | Verify memory freshness against git |
as_prompt | Export memories formatted for LLM injection |
add_conversation | Extract memories from conversation messages |
recent_activity | Recent memory activity summary |
topics | List auto-detected recurring topics |
topic_detail | Deep dive on a topic (memories, entities, timeline) |
export | Export all data to JSON |
snapshot | Create data backup |
snapshot_list | List available snapshots |
save_snapshot | Save session snapshot |
review_digest | Get pending connections for review |
review_connection | Approve/reject a pending connection |
on_this_day | Memories from same date across years |
suggest | Proactive memory recommendations based on session context |
remember_observation | Record a structured observation from a session |
search | Progressive-disclosure compact index (id, title, score) |
get_memories | Fetch full payloads for one or more memory IDs |
timeline | Chronologically adjacent events around an anchor memory |
promote_memory | Share a private memory with the team (privateβshared) |
demote_memory | Unshare a memory, making it private again |
supersede | Mark a memory as superseded by a newer one |
list_at_time | List memories that were canonical at a given time |
consolidate_memories | Create a merged memory and supersede all sources |
provenance | Full lineage for a memory (sources + supersession chain) |
supersession_chain | Supersession audit chain for a memory |
facts_at_time | Facts about an entity that were valid at a given time |
supersede_fact | Supersede a fact with a newer one (never deletes) |
fact_supersession_chain | Correction trail for a fact |
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | β | PostgreSQL connection string |
LORE_PORT | 8765 | Server port |
LORE_API_KEY | β | API key for authentication |
LORE_API_URL | http://localhost:8765 | Remote server URL |
LORE_PROJECT | β | Default project scope |
LORE_SNAPSHOT_THRESHOLD | 30000 | Characters before auto-snapshot |
LORE_ENRICHMENT_ENABLED | false | Enable LLM enrichment pipeline |
LORE_ENRICHMENT_MODEL | gpt-4o-mini | Model for enrichment |
LORE_LLM_PROVIDER | β | LLM provider override |
LORE_LLM_API_KEY | β | LLM API key |
LORE_LLM_MODEL | β | LLM model override |
LORE_LLM_BASE_URL | β | LLM base URL |
LORE_GRAPH_DEPTH | 2 | Default graph traversal depth |
LORE_GRAPH_CONFIDENCE_THRESHOLD | 0.5 | Entity confidence threshold |
LORE_GRAPH_EXTRACTION_ENABLED | true | Entity extraction from new memories. On by default β entities come from local spaCy NER (no LLM, no claude CLI), with a proper-noun heuristic fallback when spaCy/en_core_web_sm isn't installed. Set false to disable. Install lore-sdk[ner] + python -m spacy download en_core_web_sm for best entities. |
LORE_GRAPH_LLM | false | Use the claude CLI to extract entities and relationships (subjectβpredicateβobject) instead of local entity-only extraction. Needs Claude Code on PATH. |
LORE_GRAPH_EXTRACTION_CONCURRENCY | 2 | Max concurrent claude extraction subprocesses (LLM path only) |
LORE_GRAPH_EXTRACTION_TIMEOUT | 30 | Per-extraction subprocess timeout, seconds (LLM path only) |
LORE_CONTRADICTION_DETECTION | auto | Write-time contradiction detection + soft-supersession. Auto-on when OPENAI_API_KEY is set (it's LLM-scored); set true/false to override. Flags the new memory and soft-supersedes the older contradicted one (recall suppresses superseded memories Γ0.1 β not deleted). |
LORE_CONTRADICTION_SUPERSEDE | true | Soft-supersede the older contradicted memory (last-write-wins). false = flag-only (old behavior). Only your own / unowned memories are superseded; cross-agent conflicts are flag-only. |
LORE_CONTRADICTION_SUPERSEDE_MIN_CONFIDENCE | 0.75 | Confidence bar to supersede (higher than the flag bar, LORE_CONTRADICTION_MIN_CONFIDENCE=0.6). |
LORE_AUTO_SAVE | true | Auto-capture (Claude Code hooks) master switch; false disables all capture. |
LORE_CAPTURE_N | 0 | Auto-capture mid-session batch size. 0 = buffer-only (extract per-turn at Stop); >0 spawns capture-extract every N tool calls (the old default was 10). |
LORE_EXTRACT_ON_STOP | true | Auto-capture: extract once per completed agent turn (Stop hook). false = strict end-of-session-only extraction. |
LORE_HTTP_TIMEOUT | 30 | HTTP timeout (seconds) |
OPENAI_API_KEY | β | Auto-enables enrichment when set |
SLO_CHECK_INTERVAL | 60 | SLO evaluation interval (seconds) |
ALERT_WEBHOOK_URL | β | Default webhook URL for SLO alerts |
SMTP_HOST | β | SMTP server for email alerts |
SMTP_PORT | 587 | SMTP port |
SMTP_USER | β | SMTP username |
SMTP_FROM | β | Email sender address |
AUTH_MODE | api-key-only | Auth mode: api-key-only, dual, oidc-required |
LORE_WORKSPACE | β | Default workspace slug |
| Operation | Latency |
|---|---|
/v1/retrieve (warm) | ~20ms |
remember() (no LLM) | < 100ms |
recall() 100 memories | < 50ms |
recall() 10K memories | < 200ms |
recall() graph-enhanced | < 500ms |
| Embedding (500 words) | < 200ms |
MIT
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/lore)<a href="https://allmcps.com/mcp/lore"><img src="https://allmcps.com/api/badge/lore?style=directory" alt="Lore on AllMCPs" /></a>