davidgut1982/lore-mcp

🧠 Knowledge & Memory🟒 Verified Active
0 Views
0 Installs

🐍 🏠 ☁️ 🍎 πŸͺŸ 🐧 - Persistent knowledge layer for AI agents. KB, investigation threads, journal with multi-agent attribution. SQLite/PostgreSQL/Supabase.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "davidgut1982-lore-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "davidgut1982-lore-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

Lore

lore-knowledge-mcp Β· Operational knowledge layer for engineering teams and their AI agents.

PyPI version CI Python MCP Hybrid Search License: MIT

Lore demo


The Problem

Your agents start every session knowing nothing about your systems. Every runbook you've written. Every gotcha you've hit. Every incident you've debugged. None of it carries forward.

You re-explain. They re-discover. Context vanishes when the session ends.

Lore fixes that.

Without Lore                     With Lore
─────────────────────────────    ──────────────────────────────────
Agent starts fresh every time    Agent queries Lore on startup
"How does our infra work?"       Gets: topology, gotchas, runbooks,
You re-explain everything        past incidents, verified decisions
Context lost at session end      Knowledge persists across all sessions

How It's Different

ToolBuilt forWhat it remembersAgent-native
OB1 / personal memoryOne personYour thoughts and capturesNo
Mem0 / ZepApp developersUser preferences, conversationsPartially
Confluence / NotionHuman teamsDocumentation (human-browsed)No
LoreEngineering teams + AI agentsHow your systems actually work β€” searchable by meaning, not just keywordsYes

Lore is not a second brain. It's the operational intelligence your agents need to work in your environment β€” not just any environment.


What Lore Does

Knowledge Base

Your team's operational knowledge β€” always queryable by any agent. Capture the things that matter: runbooks, hard-won gotchas, architecture decisions, deployment state. Every entry carries attribution so agents know who wrote it and whether a human has verified it.

Investigations

When something breaks, open a structured investigation. Document the symptom, test hypotheses, record what you tried and what you found. Six months later when the same issue resurfaces β€” different engineer, different agent β€” the trail is there.

Journal

A permanent record of milestones, architecture decisions, and buying decisions. The kind of thing that lives in someone's head until they leave the team.


Built for Multi-Agent Systems

In a multi-agent environment, provenance matters. Every Lore entry carries author, source_type, and verified.

kb_search("proxmox lxc dns")

  [1] "LXC inherits host resolv.conf β€” Tailscale breaks containers"
      david Β· human Β· βœ“ verified

  [2] "LXC DNS fix after Tailscale install"
      engineer-agent Β· agent Β· unreviewed

  [3] "LXC DNS configuration reference"
      research-agent Β· agent Β· βœ— disputed

Your agents know: result 1 is production-safe. Result 2, spot-check before acting. Result 3, review first.


Semantic Search

Lore finds entries by meaning, not just keywords. Search "DNS broken in containers" and it returns an entry titled "LXC containers inherit resolv.conf from the host" β€” no keyword overlap required.

Powered by local sentence-transformers embeddings (no API key, no external calls), combined with lexical full-text search and Reciprocal Rank Fusion. The same model used by mcp-memory-service, fully self-hosted. On SQLite the lexical leg uses FTS5; on PostgreSQL it uses a GIN full-text index plus pgvector for the semantic leg.

Enable it

pip install lore-knowledge-mcp[semantic]
LORE_SEMANTIC_SEARCH=true lore-mcp

Search modes

kb_search resolves its mode from (in order): an explicit search_mode/semantic/hybrid argument, then LORE_SEARCH_MODE_DEFAULT, then the built-in default of hybrid. Every search response echoes requested_mode (the caller's intent) alongside search_mode (the mode actually executed, after any degradation).

ModeWhen to use
ftsExact term matches.
semanticMeaning-based retrieval, no keyword overlap needed.
hybridBest of both β€” lexical + vector via RRF (default).

The summary mode was removed β€” passing search_mode="summary" now returns a validation error. Lore is LLM-free by design; summarisation is the caller's responsibility.

Backfill existing KB

If you already have entries, generate embeddings for them:

kb_backfill_embeddings()    # idempotent, safe to re-run
kb_embedding_status()       # check coverage

Configuration

VariableDefaultNotes
LORE_SEMANTIC_SEARCHfalseMaster switch β€” off = lexical-only behaviour.
LORE_SEARCH_MODE_DEFAULThybridDefault mode for kb_search when no mode is passed (fts, semantic, or hybrid).
LORE_EMBEDDING_MODELall-MiniLM-L6-v2384d, ~90MB, English-optimized.
LORE_RRF_K10Increase to 30–60 for corpora >10k entries.

For multilingual content, set LORE_EMBEDDING_MODEL=paraphrase-multilingual-MiniLM-L12-v2 (same 384d, no schema change).


Automatic Memory Extraction

Lore can extract durable memories from agent conversations automatically. At the end of a session, conversation turns are sent asynchronously to a fast LLM, which extracts facts, preferences, goals, events, and system facts β€” then deduplicates them against the existing KB before writing.

  • Opt-in β€” disabled by default (auto_extract.enabled: false).
  • Two providers β€” OpenRouter (default, simple setup) or Cerebras direct API (gpt-oss-120b, 300+ TPS, high prompt-cache hit rate).
  • Graceful degradation β€” a missing API key, HTTP error, or bad JSON returns an empty result silently; it never raises and never blocks the session.
  • Auditable β€” every auto-extracted entry is tagged source:auto-extracted, with an optional review queue (topic="auto-memory-pending") for human approval.

Set OPENROUTER_API_KEY (or CEREBRAS_API_KEY) and enable it in your plugin config.

β†’ Full setup guide: docs/auto-extraction-setup.md β€” API keys, provider config, tuning thresholds, review mode, and inspecting or removing extracted entries.


Automating Lore in Your Workflow

Add one line to every agent's system prompt and one entry to ~/.mcp.json β€” that's the entire integration. Each phase of your engineering workflow reads prior knowledge from Lore and writes its findings back, so nothing is re-discovered from scratch.

β†’ How to wire Lore into a 6-phase multi-agent pipeline β€” full walkthrough with code examples for every phase: research, architecture review, implementation, adversarial code review, QA, and documentation.


Quick Start

No database setup required. Lore runs out of the box with SQLite.

1. Install

pip install lore-knowledge-mcp

Optional: semantic search

pip install lore-knowledge-mcp[semantic]

Then set LORE_SEMANTIC_SEARCH=true. See Semantic Search for details.

2. Start the server

# Stdio mode (for local MCP clients like Claude Code)
lore-mcp

# HTTP mode (for remote or multi-agent access)
lore-mcp --host 0.0.0.0 --port 8000

# HTTP mode WITH authentication (recommended for teams / LAN exposure)
LORE_API_KEY="$(openssl rand -hex 32)" lore-mcp --host 0.0.0.0 --port 8000

Authentication (LORE_API_KEY)

HTTP auth is opt-in and off by default:

  • LORE_API_KEY unset β†’ the HTTP server is open (no auth), exactly as before. This keeps existing no-auth deployments working. When you bind to a non-localhost host (0.0.0.0 or a LAN IP) without a key, Lore logs a prominent startup WARNING that the server is reachable on your network with no authentication.
  • LORE_API_KEY set β†’ every HTTP/SSE request must include Authorization: Bearer <key>. Missing or wrong tokens get 401 {"error":"unauthorized"} (token compared in constant time). Health endpoints (/health, /healthz, /) stay open so liveness probes keep working. stdio mode is never affected β€” it has no network surface.

The same rule applies to the HTTP entry point (lore-mcp --host/--port, which invokes the FastMCP server).

CORS: origins default to * with credentials disabled (the spec forbids * + credentials). Set LORE_CORS_ORIGINS to a comma-separated allow-list (e.g. https://app.example.com,https://admin.example.com) to restrict origins; credentialed CORS is enabled automatically when origins are explicit.

3. Add to your MCP client

Claude Code / Claude Desktop β€” add to ~/.mcp.json:

{
  "mcpServers": {
    "lore": {
      "type": "stdio",
      "command": "lore-mcp"
    }
  }
}

Or for HTTP mode (recommended for teams). When the server is started with LORE_API_KEY set, include a matching bearer token in the client config:

{
  "mcpServers": {
    "lore": {
      "type": "http",
      "url": "http://localhost:8000/mcp",
      "headers": {
        "Authorization": "Bearer <your LORE_API_KEY>"
      }
    }
  }
}

If the server is started without LORE_API_KEY, omit the headers block β€” the endpoint is open.

That’s it. Lore is ready.


Tool Reference

Knowledge Base

ToolWhat it does
kb_addAdd an entry. Accepts author, source_type for attribution.
kb_searchSemantic / hybrid / FTS search with optional topic filter.
kb_getFetch full entry by ID.
kb_get_batchFetch multiple entries by ID in a single call (re-keyed by kb_id).
kb_listList entries, filter by topic.
kb_updateUpdate content, tags, or set verified flag.
kb_deleteDelete entry (requires confirm=true).
kb_backfill_embeddingsGenerate embeddings for existing entries (idempotent).
kb_embedding_statusReport embedding coverage across the KB.

Investigations

ToolWhat it does
investigation_addOpen or add to an investigation.
investigation_listList investigations, filter by topic.
investigation_getFetch full investigation by ID.
investigation_log_experimentLog a structured hypothesis β†’ result β†’ conclusion.
investigation_list_experimentsList all logged experiments.
investigation_delete_noteHard-delete a note (requires confirm=true; production guard).
investigation_delete_experimentHard-delete an experiment (requires confirm=true; production guard).

Journal

ToolWhat it does
journal_appendAdd a milestone, decision, or reflection.
journal_listList recent entries (default 20).
journal_getFetch entry by ID.
journal_deleteHard-delete an entry (requires confirm=true; production guard).
snapshot_configSnapshot a config object to the journal.

Document Ingestion

ToolWhat it does
kb_ingest_docIngest a markdown file into the KB (strategy: full or chunked).
kb_ingest_dirBatch-ingest a directory, with change detection.
kb_sync_statusCheck what's changed since last sync.

MCP Index

ToolWhat it does
mcp_index_scanScan all configured MCP servers and index their tools.
mcp_index_searchSearch indexed tools by description.
mcp_index_get_serverGet all tools for a specific MCP server.
mcp_index_rebuildForce a full rescan.

Search

ToolWhat it does
multi_searchSearch across KB, investigations, journal, and transcripts at once.
search_localSearch local files by content.
search_transcriptsSearch Whisper transcript segments.
deduplicate_resultsDeduplicate a result set by similarity threshold.
cluster_resultsCluster results by topic.

Backends

SQLitePostgreSQL
Setup requiredNoneExisting PostgreSQL instance
Best forSolo developers, local useTeams, shared agents, production
ConfigDB_BACKEND=sqlite (default)DB_BACKEND=postgres + connection vars
Data location./knowledge-data/ (override with KNOWLEDGE_DATA_DIR)Your database
Semantic searchsqlite-vec + FTS5pgvector + GIN full-text index

SQLite is the default. No configuration needed β€” just install and run. The SQLite database and any local-file search corpus live under KNOWLEDGE_DATA_DIR, which defaults to ./knowledge-data (a portable, relative path β€” set it to an absolute path for a stable on-disk location).

PostgreSQL is for teams who want a shared knowledge layer accessible from multiple machines or agents simultaneously. DB_BACKEND=postgres (and the postgresql alias) select the bundled local PostgreSQL client β€” the same path as DB_BACKEND=local. Connection defaults are generic (DB_NAME=lore, DB_USER=lore_user); override them with the connection variables below. On PostgreSQL, hybrid search uses a combined title+content GIN full-text index for the lexical leg and pgvector for the semantic leg.

# PostgreSQL setup
export DB_BACKEND=postgres          # "postgresql" and "local" also work
export DB_HOST=your-db-host
export DB_PORT=5432
export DB_NAME=lore                 # default: lore
export DB_USER=your-user            # default: lore_user
export DB_PASSWORD=your-password
lore-mcp

Configuration reference

Env varDefaultPurpose
DB_BACKENDsqlitesqlite, postgres/postgresql/local, or supabase.
KNOWLEDGE_DATA_DIR./knowledge-dataRoot for the SQLite DB and local-file search. Portable by default β€” no /srv paths.
DB_NAMElorePostgreSQL database name.
DB_USERlore_userPostgreSQL user.
LORE_SEMANTIC_SEARCHfalseMaster switch for semantic/hybrid search (requires the [semantic] extra).
LORE_SEARCH_MODE_DEFAULThybridDefault kb_search mode when none is passed (fts, semantic, hybrid).
OPENROUTER_API_KEY(unset)API key for automatic memory extraction via OpenRouter. See Automatic Memory Extraction.
CEREBRAS_API_KEY(unset)API key for automatic memory extraction via the Cerebras direct API.
LATVIAN_LEARNING_ROOT(unset)Optional corpus root for search_local. Unset β†’ that source is skipped.
LATVIAN_XTTS_ROOT(unset)Optional transcript root for search_transcripts. Unset β†’ returns a clean "not configured" result.
INGEST_ROOT(unset)Optional corpora root for search_corpora. Unset β†’ returns a clean "not configured" result.
LORE_API_KEY(unset)Opt-in HTTP auth. Set β†’ require Authorization: Bearer <key> on HTTP/SSE requests (401 otherwise). Unset β†’ HTTP is open (and a warning is logged on non-localhost binds). stdio is never affected.
LORE_CORS_ORIGINS*Comma-separated CORS allow-list. * (default) disables credentials per the CORS spec; explicit origins enable credentialed CORS.

The deployment-specific search roots (LATVIAN_LEARNING_ROOT, LATVIAN_XTTS_ROOT, INGEST_ROOT) are unset by default. When a root is not configured, the dependent search tool returns an empty, clearly-labelled "not configured" result instead of scanning a nonexistent path β€” so a fresh install works out of the box.


Hermes Memory Provider

A Hermes agent memory provider plugin that backs conversation memory with Lore is available as a separate package:

hermes-lore-plugin β€” drop-in memory provider for the Hermes agent. Stores KB entries in Lore, prefetches relevant context on session start, and deduplicates before storing. It also drives the automatic memory extraction pipeline.


License

MIT β€” see LICENSE

Related MCP Servers

modelcontextprotocol/server-memoryVerified

πŸ“‡ 🏠 - Knowledge graph-based persistent memory system for maintaining context

🧠 Knowledge & Memory2 views
0xshellming/mcp-summarizer

πŸ“• ☁️ - AI Summarization MCP Server, Support for multiple content types: Plain text, Web pages, PDF documents, EPUB books, HTML content

🧠 Knowledge & Memory0 views
20alexl/claude-engram

🐍 🏠 - Persistent memory and session intelligence for Claude Code. Auto-tracks mistakes, decisions, and context via hooks. Mines session history for patterns and cross-session search. Loop detection, pre-edit warnings, context compaction survival. Runs locally with Ollama.

🧠 Knowledge & Memory0 views
a2cr/a2cr

🐍 ☁️ 🏠 🍎 πŸͺŸ 🐧 - MCP server for AI-agent handoffs. Saves client-encrypted WorkBaton checkpoints and WorkStash notes so Codex, Claude Code, Roo Code, and other MCP clients can resume work without passing full chat history.

🧠 Knowledge & Memory0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Active

Recent health check succeeded.

Last checked: 7/28/2026, 9:26:46 PM

Unclaimed listing (imported or pending owner verification). Claim it β†’
β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.