Lore
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**lore-knowledge-mcp** · Operational knowledge layer for engineering teams and their AI agents.
---
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.**
---
How It's Different
| Tool | Built for | What it remembers | Agent-native |
|---|---|---|---|
| OB1 / personal memory | One person | Your thoughts and captures | No |
| Mem0 / Zep | App developers | User preferences, conversations | Partially |
| Confluence / Notion | Human teams | Documentation (human-browsed) | No |
| **Lore** | **Engineering teams + AI agents** | **How your systems actually work — searchable by meaning, not just keywords** | **Yes** |
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.
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
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).
| Mode | When to use |
|---|---|
| fts | Exact term matches. |
| semantic | Meaning-based retrieval, no keyword overlap needed. |
| hybrid | Best 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:
Configuration
| Variable | Default | Notes |
|---|---|---|
| LORE_SEMANTIC_SEARCH | false | Master switch — off = lexical-only behaviour. |
| LORE_SEARCH_MODE_DEFAULT | hybrid | Default mode for kb_search when no mode is passed (fts, semantic, or hybrid). |
| LORE_EMBEDDING_MODEL | all-MiniLM-L6-v2 | 384d, ~90MB, English-optimized. |
| LORE_RRF_K | 10 | Increase 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.