Lore

io.github.agentkitai由 GitHub 帳號 agentkitai 發布v1.4.2更新於 Oct 24, 2026

Cross-agent memory over MCP: hybrid recall, knowledge graph, private/shared visibility, redaction.

概覽

AI 產生的概覽

Lore 是跨代理記憶層,讓助手跨工作階段儲存、檢索並連結知識,並提供知識圖譜與雙時態歷史。

可以做什麼
儲存、搜尋、列出、投票和刪除記憶,支援類型、層級與標籤,並提供統計和依工作階段脈絡的主動建議。瀏覽知識圖譜:走訪實體與關係、擷取並列出事實、偵測衝突,查看主題與相關內容。不刪除地查詢歷史:取代記憶與事實,查詢某日期時的正式內容或真實情況,追溯來源與更正鏈。以 JSON 或 Markdown 匯出與備份資料,建立與列出快照,並依風險分數審閱待處理的圖譜連結。
適用情境
適合希望助手在多次對話或不同程式代理之間延續脈絡,並保留可稽核、可更正的事實記錄而非扁平筆記的情境。也適合需要區分共享與私有記憶、進行歷史查詢的團隊。
執行需求
透過 uvx 從 lore-sdk 套件以本機程序執行,需要已運作的 Lore 伺服器,後端為搭配 pgvector 的 PostgreSQL(Docker Compose 或 pip 安裝)。伺服器透過類似 的位址存取,可選 API 金鑰。可選的 LLM 增強與矛盾偵測使用 OpenAI 金鑰或 Claude CLI。
安裝前請注意
記憶會被持久保存;啟用鉤子後對話脈絡會被自動擷取並注入提示,敏感內容可能被留存,PII 去識別化雖有聲明但應自行驗證。伺服器可刪除記憶並取代事實,共享記憶會對團隊可見。啟用可選 LLM 功能時內容會傳送給外部供應商。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lore,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Lore — Universal AI Memory Layer

[PyPI] [npm] [Container] [Python 3.10+] [License: MIT] [MCP Compatible] [Tests]

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.

User: "What API rate limits should I use?"
── Lore hook fires (20ms) ──────────────────────────────🧠 Relevant memories from Lore:- [0.82] Stripe API returns 429 after 100 req/min — use exponential backoff- [0.71] Our internal API rate limit is 500 req/min per API key────────────────────────────────────────────────────────
Agent sees memories + prompt → responds with full context

Features

Universal Memory

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.

Knowledge Graph

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.

Bi-Temporal Facts & Supersession

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.

Graph Visualization

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.

Session Continuity

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

recent_activity

Session-aware summary of what happened recently across all projects. Gives agents continuity between conversations without manual context-passing.

Topic Notes

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

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.

Approval UX with Risk Scoring

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.

Guided Bootstrap

lore bootstrap

Single command that validates Python version, Postgres, pgvector, Docker, runs migrations, and verifies server health. Use --fix to auto-remediate missing dependencies.

Multi-Agent Setup

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.

SLO Dashboard + Alerting

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.

Adaptive Retrieval Profiles

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.

Policy-Based Retention

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.

Multi-Tenant Workspaces

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.).

Plugin SDK

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.

Proactive Recommendations

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.

Retrieval Analytics

GET /v1/analytics/retrieval · Prometheus metrics

Track hit rate, score distribution, memory utilization, and latency. Know whether memories are actually helping your agents.

Quick Start

Docker Compose (recommended)

bash
git clone https://github.com/agentkitai/lore.gitcd loredocker compose up -d

Starts Postgres with pgvector and the Lore server on http://localhost:8765.

pip

bash
pip install "lore-sdk[server,solo]"lore serve  # starts on port 8765

Verify it works

bash
curl http://localhost:8765/v1/memories

Add Lore as an MCP server

One line — no install — drops Lore into any MCP client (Claude Code, Cursor, VS Code, Codex, Claude Desktop):

jsonc
// Claude Code: .mcp.json  ·  Claude Desktop: claude_desktop_config.json{  "mcpServers": {    "lore": { "command": "uvx", "args": ["--from", "lore-sdk[mcp]", "lore-memory"] }  }}

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.

Multi-Agent Setup

Claude Code

Option A: Auto-retrieval hook (recommended)

bash
lore setup claude-code

This installs a UserPromptSubmit hook that auto-injects relevant memories into every prompt.

Option B: MCP tools

Add to ~/.claude/settings.json:

json
{  "mcpServers": {    "lore": {      "command": "lore",      "args": ["mcp"],      "env": {        "LORE_API_URL": "http://localhost:8765",        "LORE_API_KEY": "your-api-key"      }    }  }}

OpenClaw

bash
lore setup openclaw

Installs a message:preprocessed hook for auto-retrieval. Memories appear in context before every agent response.

Cursor

bash
lore setup cursor

Installs a beforeSubmitPrompt hook. Also add MCP config to .cursorrules:

json
{  "mcpServers": {    "lore": {      "command": "lore",      "args": ["mcp"],      "env": {        "LORE_API_URL": "http://localhost:8765",        "LORE_API_KEY": "your-api-key"      }    }  }}

Codex CLI

bash
lore setup codex

Installs a beforePlan hook. Add MCP config:

json
{  "mcpServers": {    "lore": {      "command": "lore",      "args": ["mcp"],      "env": {        "LORE_API_URL": "http://localhost:8765",        "LORE_API_KEY": "your-api-key"      }    }  }}

Any HTTP client

Auto-retrieval works with any system that can make an HTTP call before sending a prompt:

bash
curl -s "http://localhost:8765/v1/retrieve?query=your+prompt&limit=5&min_score=0.3&format=markdown" \  -H "Authorization: Bearer $LORE_API_KEY"

MCP Tools Reference

ToolDescription
rememberStore a memory with type, tier, tags, metadata
recallSemantic search with temporal/graph-enhanced retrieval
forgetDelete a memory by ID
list_memoriesList memories with filtering
statsMemory statistics (total, by type/tier)
upvote_memoryBoost memory ranking
downvote_memoryLower memory ranking
graph_queryHop-by-hop knowledge graph traversal
entity_mapList entities (optional D3 format)
relatedFind related memories/entities
extract_factsExtract (subject, predicate, object) triples
list_factsList active facts
conflictsList detected fact conflicts
classifyIntent, domain, emotion classification
enrichLLM-powered metadata extraction
consolidateMerge duplicate/related memories
ingestAccept content from external sources
github_syncSync GitHub repo data
check_freshnessVerify memory freshness against git
as_promptExport memories formatted for LLM injection
add_conversationExtract memories from conversation messages
recent_activityRecent memory activity summary
topicsList auto-detected recurring topics
topic_detailDeep dive on a topic (memories, entities, timeline)
exportExport all data to JSON
snapshotCreate data backup
snapshot_listList available snapshots
save_snapshotSave session snapshot
review_digestGet pending connections for review
review_connectionApprove/reject a pending connection
on_this_dayMemories from same date across years
suggestProactive memory recommendations based on session context
remember_observationRecord a structured observation from a session
searchProgressive-disclosure compact index (id, title, score)
get_memoriesFetch full payloads for one or more memory IDs
timelineChronologically adjacent events around an anchor memory
promote_memoryShare a private memory with the team (private→shared)
demote_memoryUnshare a memory, making it private again
supersedeMark a memory as superseded by a newer one
list_at_timeList memories that were canonical at a given time
consolidate_memoriesCreate a merged memory and supersede all sources
provenanceFull lineage for a memory (sources + supersession chain)
supersession_chainSupersession audit chain for a memory
facts_at_timeFacts about an entity that were valid at a given time
supersede_factSupersede a fact with a newer one (never deletes)
fact_supersession_chainCorrection trail for a fact

CLI Reference

bash
# Memory operationslore remember "API rate limit is 100 req/min" --tags api,limitslore recall "rate limits" --limit 5lore forget <memory-id>lore memories --tier long_termlore stats
# Knowledge graphlore graph "authentication" --depth 2lore entities --limit 50lore facts "extract facts from this text"lore conflicts
# Session & contextlore recent --hours 24lore on-this-day
# Export & backuplore export --format json > backup.jsonlore import backup.jsonlore snapshot-save --title "before refactor"
# Server & setuplore bootstrap               # validate prerequisiteslore serve                    # start HTTP serverlore mcp                     # start MCP serverlore ui                      # start web UIlore setup claude-code       # install hookslore setup claude-code --validate --test-connection
# SLO managementlore slo create --name "P99 < 50ms" --metric p99_latency --threshold 50 --operator ltlore slo statuslore slo alerts
# Retrieval profileslore profiles listlore profiles create --name fast-coding --semantic-weight 1.0 --recency-bias 7
# Retention policieslore policy create --name prod --snapshot-schedule "0 2 * * *" --max-snapshots 30lore policy compliancelore restore-drill --latest
# Workspaceslore workspace create dev-teamlore workspace switch dev-teamlore audit --since 24h
# Pluginslore plugin create my-taggerlore plugin listlore plugin reload my-tagger
# Recommendationslore suggest --context "setting up docker"
# Review (with risk scoring)lore review list --sort risklore review approve <id> --note "Verified"lore review batch approve --ids id1,id2
# API keyslore keys create --name "my-agent"lore keys listlore keys revoke <key-id>

API Reference

Key endpoints

# Memory CRUDGET    /v1/retrieve                    # Auto-retrieval (for hooks)POST   /v1/memories                    # Create memoryPOST   /v1/memories/search             # Semantic searchGET    /v1/memories                    # List memoriesGET    /v1/memories/{id}               # Get memoryPATCH  /v1/memories/{id}               # Update memoryDELETE /v1/memories/{id}               # Delete memory
# Knowledge graphGET    /v1/graph                       # Knowledge graphGET    /v1/graph/topics                # Topic listGET    /v1/graph/topics/{name}         # Topic detailGET    /v1/graph/entity/{id}           # Entity detail
# Bi-temporal & supersession (history without deletion)POST   /v1/memories/{id}/supersede            # Mark superseded (by=null un-supersedes)GET    /v1/memories/at_time                   # Memories canonical as of ?at=<ts>GET    /v1/memories/{id}/supersession-chain   # Memory correction audit trailGET    /v1/memories/{id}/provenance           # Full lineage (sources + chain)POST   /v1/memories/consolidate               # Merge N memories + supersede sourcesGET    /v1/facts/at_time                      # Facts about an entity valid at ?at=<ts>POST   /v1/facts/{id}/supersede               # Supersede-not-delete a fact edgeGET    /v1/facts/{id}/supersession-chain      # Fact correction trailGET    /v1/timeline                           # Chronologically adjacent events
# IngestionPOST   /v1/conversations              # Extract memories from conversationPOST   /v1/ingest                     # Ingest external content
# Review + risk scoringGET    /v1/review                     # Pending reviews (sortable by risk)POST   /v1/review/{id}               # Approve/reject with notesPOST   /v1/review/bulk               # Batch approve/rejectGET    /v1/review/history             # Decision audit trail
# Export & snapshotsPOST   /v1/export                     # Export all dataPOST   /v1/import                     # Import dataPOST   /v1/export/snapshots           # Create snapshotGET    /v1/export/snapshots           # List snapshots
# SLO dashboardGET    /v1/slo                        # List SLO definitionsPOST   /v1/slo                        # Create SLOGET    /v1/slo/status                 # Current pass/fail per SLOGET    /v1/slo/alerts                 # Alert historyGET    /v1/slo/timeseries             # Time-series for charts
# Retrieval profilesGET    /v1/profiles                   # List profilesPOST   /v1/profiles                   # Create profileGET    /v1/retrieve?profile=coding    # Retrieve with profile
# Retention policiesGET    /v1/policies                   # List policiesPOST   /v1/policies                   # Create policyGET    /v1/policies/compliance        # Compliance summaryPOST   /v1/policies/{id}/drill       # Execute restore drill
# Workspaces + RBACPOST   /v1/workspaces                 # Create workspaceGET    /v1/workspaces                 # List workspacesPOST   /v1/workspaces/{id}/members   # Add memberGET    /v1/audit                      # Query audit log
# PluginsGET    /v1/plugins                    # List pluginsPOST   /v1/plugins/{name}/enable     # Enable pluginPOST   /v1/plugins/{name}/reload     # Hot-reload plugin
# RecommendationsPOST   /v1/recommendations           # Get proactive suggestionsPOST   /v1/recommendations/{id}/feedback  # Thumbs up/downPATCH  /v1/recommendations/config    # Adjust aggressiveness
# Setup validationPOST   /v1/setup/validate            # Test connectivity
# Analytics & monitoringGET    /v1/recent                     # Recent activityGET    /v1/analytics/retrieval        # Retrieval analyticsGET    /metrics                       # Prometheus metrics
# API keysPOST   /v1/keys                       # Create API keyGET    /v1/keys                       # List API keysDELETE /v1/keys/{id}                  # Revoke API key

Configuration

VariableDefaultDescription
DATABASE_URL—PostgreSQL connection string
LORE_PORT8765Server port
LORE_API_KEY—API key for authentication
LORE_API_URLhttp://localhost:8765Remote server URL
LORE_PROJECT—Default project scope
LORE_SNAPSHOT_THRESHOLD30000Characters before auto-snapshot
LORE_ENRICHMENT_ENABLEDfalseEnable LLM enrichment pipeline
LORE_ENRICHMENT_MODELgpt-4o-miniModel 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_DEPTH2Default graph traversal depth
LORE_GRAPH_CONFIDENCE_THRESHOLD0.5Entity confidence threshold
LORE_GRAPH_EXTRACTION_ENABLEDtrueEntity 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_LLMfalseUse 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_CONCURRENCY2Max concurrent claude extraction subprocesses (LLM path only)
LORE_GRAPH_EXTRACTION_TIMEOUT30Per-extraction subprocess timeout, seconds (LLM path only)
LORE_CONTRADICTION_DETECTIONautoWrite-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_SUPERSEDEtrueSoft-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_CONFIDENCE0.75Confidence bar to supersede (higher than the flag bar, LORE_CONTRADICTION_MIN_CONFIDENCE=0.6).
LORE_AUTO_SAVEtrueAuto-capture (Claude Code hooks) master switch; false disables all capture.
LORE_CAPTURE_N0Auto-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_STOPtrueAuto-capture: extract once per completed agent turn (Stop hook). false = strict end-of-session-only extraction.
LORE_HTTP_TIMEOUT30HTTP timeout (seconds)
OPENAI_API_KEY—Auto-enables enrichment when set
SLO_CHECK_INTERVAL60SLO evaluation interval (seconds)
ALERT_WEBHOOK_URL—Default webhook URL for SLO alerts
SMTP_HOST—SMTP server for email alerts
SMTP_PORT587SMTP port
SMTP_USER—SMTP username
SMTP_FROM—Email sender address
AUTH_MODEapi-key-onlyAuth mode: api-key-only, dual, oidc-required
LORE_WORKSPACE—Default workspace slug

Architecture

┌──────────────────────────────────────────────────────────────┐│                      Agent Runtimes                          ││  Claude Code · OpenClaw · Cursor · Codex · Any HTTP client   │└──────────┬──────────────────────────────────┬────────────────┘           │ hooks (auto-retrieval)           │ MCP tools           ▼                                  ▼┌──────────────────────────────────────────────────────────────┐│                     Lore Server (:8765)                       ││                                                              ││  REST API · MCP Server · Web UI (/ui/) · Plugin SDK          ││                                                              ││  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────┐ ││  │  Embedder   │  │  Knowledge   │  │  LLM Pipeline       │ ││  │  (ONNX)     │  │  Graph       │  │  (optional)         │ ││  │  pgvector   │  │  + Review    │  │  classify · enrich   │ ││  │  + Profiles │  │  + Risk      │  │  extract · recommend │ ││  └─────────────┘  └──────────────┘  └─────────────────────┘ ││                                                              ││  ┌─────────────┐  ┌──────────────┐  ┌─────────────────────┐ ││  │  SLO        │  │  Retention   │  │  Workspaces         │ ││  │  Checker    │  │  Scheduler   │  │  + RBAC             │ ││  │  + Alerting │  │  + Drills    │  │  + Audit Log        │ ││  └─────────────┘  └──────────────┘  └─────────────────────┘ │└──────────────────────────┬───────────────────────────────────┘                           │              ┌────────────▼────────────┐              │   PostgreSQL + pgvector  │              │   memories · entities    │              │   relationships · facts  │              │   slo · profiles · audit │              │   workspaces · policies  │              └─────────────────────────┘

Performance

OperationLatency
/v1/retrieve (warm)~20ms
remember() (no LLM)< 100ms
recall() 100 memories< 50ms
recall() 10K memories< 200ms
recall() graph-enhanced< 500ms
Embedding (500 words)< 200ms

Contributing

bash
git clone https://github.com/agentkitai/lore.gitcd lorepip install -e ".[dev,server,mcp,enrichment]"docker compose up -d db  # Postgres + pgvectorpytest

License

MIT

來源:README.md,提交 f2fd553

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.4.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分