Ebb
Provides AI agents with a temporal knowledge graph where knowledge relevance decays over time, enabling memory recall, reinforcement, and auto-archiving through MCP tools.
README
Ebb — an agent-first knowledge graph
Long-term memory for AI agents, built as a graph. Relevance is recency-weighted connection strength: reusing knowledge keeps it alive, unused knowledge decays and is archived, and nothing is deleted until a human signs off. Runs embedded (zero infra) or on Neo4j (production).
The two mechanisms it's built around — connection-weighted relevance and time-decay — are native graph operations, and both have deep prior art (PageRank/centrality; ACT-R base-level activation and spreading activation from cognitive science; spaced-repetition forgetting curves). This is a small, honest implementation of that lineage aimed specifically at agent memory.
Why it's built this way
1. The engine and the interface are separate. The graph store sits behind a
small interface (GraphStore). Agents and the scoring logic never touch a
specific database, so you can run the exact same graph on an embedded engine
today and swap to Neo4j later with one env var.
2. Relevance is recency-weighted, not raw connection count. "More
connections = more relevant" rewards old, heavily-referenced data forever — the
exact stale-data problem the system is meant to kill. Here, every edge's
contribution to relevance is multiplied by a time-decay factor keyed to when the
connection was last reinforced. An edge reinforced yesterday counts near-full;
one last touched six months ago counts for almost nothing. Reusing a connection
(recall/reinforce) resets its clock — so relevance tracks what's actually
live, and stale knowledge sinks on its own.
Proof, from the demo seed graph (python -m ebb.demo):
node raw# activation
decision:outcome-pricing 3 6.116 <- fresh, few links, ranks #1
decision:seat-pricing 11 3.077 <- MOST links, ranks #3
...
note:analysis-* (x10) 1 0.051 <- decayed -> archived (tier 4)
The superseded per-seat decision has the highest raw connection count in the graph and still ranks third, behind a fresh decision with a third as many links. Raw count lost; recency won.
What's in it
- Graph model — every note, decision, meeting, person, client, fact is a node; every reference is a timestamped, typed, weighted edge.
- Scoring engine (
scoring.py) — recency-weighted activation, exponential decay (configurable half-life), one hop of spreading activation (a portable stand-in for PageRank), and tier assignment. Pure functions, fully unit-tested. - Four archive tiers — 1 hot (default recall) · 2 warm (deeper recall) · 3 cold (archived, on-demand only) · 4 frozen (pending human sign-off before deletion). Pinned nodes never auto-archive.
- MCP server (
mcp_server.py) — the agent interface:remember,recall,connect,reinforce,forget,neighbors,pin,maintain,review_queue,stats. - Two backends —
KuzuStore(embedded, default) andNeo4jStore(production), same interface, same Cypher shapes.
Quickstart (embedded — zero infra)
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m ebb.demo # narrated end-to-end walkthrough
pytest -q # 11 tests, all green
No Docker, no server, no ports. Kùzu is an in-process graph database, so the
Ebb is just a folder (./ebb_db).
Plug it into an MCP client (e.g. Claude Desktop)
- Copy the
ebbblock fromclaude_desktop_config.example.jsoninto your client's MCP config, fixing the absolute paths. - Restart the client. The ebb tools appear in the tools menu.
- The agent can now
rememberthings across sessions,recallwhat's relevant, andreinforcewhat it keeps using — with decay and archival handled for it.
Production mode (Neo4j)
docker compose up -d # Neo4j + Graph Data Science + APOC
EBB_BACKEND=neo4j NEO4J_PASSWORD=brainbrain python -m ebb.demo
Same code, same behavior. On Neo4j you additionally get the GDS library, so the
spreading-activation pass in scoring.py can graduate to real PageRank /
centrality / community detection when scale demands it. (The Neo4j backend's
Cypher mirrors the fully-tested Kùzu backend; run pytest against a live
instance before trusting it in prod.)
The model, briefly
Activation of a node =
Σ (edge.weight × decay(age_since_last_reinforced)) + read-recency-bonus,
plus one damped hop of the same from its neighbours. Decay is a half-life
(default 30 days, tunable). Tiers are cut on the activation normalised against
the most-active non-pinned node. recall blends this activation with query
text-match and returns why each result surfaced. Everything is tunable in one
place — ebb/scoring.py::Config.
Writing an ingestion adapter
Ebb is source-agnostic: anything that calls remember/connect can feed
it. A source (a notes folder, a wiki, an issue tracker) becomes a graph by
mapping documents to nodes, links/mentions to edges, and an edit timestamp to
the recency clock. Keep adapters and their data out of the repo.
Layout
src/ebb/
model.py # Node, Edge, tiers
scoring.py # decay, activation, spreading, tiering <- the core
store.py # GraphStore interface
kuzu_store.py # embedded backend (default)
neo4j_store.py # production backend
engine.py # Brain: remember/recall/connect/reinforce/maintain/...
mcp_server.py # agent-facing MCP tools
seed.py # fictional demo graph
demo.py # narrated walkthrough
tests/ # 11 tests: scoring + end-to-end
docker-compose.yml
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。