Skip to main content

MCP server that gives LLMs persistent graph-structured memory

Project description

waggle-mcp

Persistent, structured memory for AI agents — up to 4× fewer tokens than chunk-based retrieval.
Your LLM remembers facts, decisions, and context across every conversation, backed by a real knowledge graph.

PyPI Python 3.11+ MCP compatible Local embeddings MIT

Waggle-mcp MCP server Waggle-mcp MCP server score


Why waggle-mcp?

waggle-mcp is a local-first memory layer for MCP-compatible AI clients, built on a persistent knowledge graph. It gives your AI a persistent knowledge graph it can read and write through any MCP-compatible client (Claude Desktop, Cursor, Codex, Antigravity, etc.).

Stuffed context Structured retrieval
Huge prompts every session Compact subgraph retrieved at query time
Session-local memory Persistent multi-session memory
Flat notes and chunks Typed nodes and edges: decisions, reasons, contradictions
"What changed?" requires replaying logs Temporal queries and diffs are first-class

Waggle yields up to ~4× fewer tokens than naive chunked retrieval on factual queries. Graph-traversal queries spend more tokens to include necessary reasoning context such as updates, contradictions, and dependencies.


Quick start

pip install waggle-mcp
waggle-mcp init
# Restart your MCP client. Done.

init detects your MCP client, writes its config, and creates the local database directory. Default mode is local SQLite with on-device embeddings. Antigravity and manual configuration details are in docs/reference.md.


See it in action

Session 1 — April 10

User:  Let's use PostgreSQL. MySQL replication has been painful.
Agent: [calls observe_conversation()]
       → stores decision node: "Chose PostgreSQL over MySQL"
       → stores reason node:   "MySQL replication painful"
       → links them with a depends_on edge

Session 2 — April 12 (fresh context window, no history)

User:  What did we decide about the database?
Agent: [calls query_graph("database decision")]
       → retrieves the decision node + linked reason from April 10

       "You decided on PostgreSQL on April 10. The reason recorded was
        that MySQL replication had been painful."

Session 3 — April 14

User:  Actually, let's reconsider — the team is more familiar with MySQL.
Agent: [calls store_node() + store_edge(new_node → old_node, "contradicts")]
       → both positions are preserved, and the contradiction is explicit

Key Features

  • Automatic Extraction: observe_conversation ingests facts into the graph without manual schema work.
  • Portable Context: export_context_bundle generates Markdown/JSON context packs for another AI.
  • Vault Round-trip: export_markdown_vault / import_markdown_vault for Obsidian-style node editing.
  • Conflict Resolution: list_conflicts / resolve_conflict to manage contradictions without losing history.
  • Deterministic Fallback: Stable SHA-256 hashing for reliable, reproducible offline operation when transformer models are unavailable.

Benchmarks & Verification

Waggle performance is verified against checked-in fixtures and automated regression tests.

Project Fixtures

Area Corpus Result
Extraction 25-case deterministic fixture 100.0%
Retrieval 18-query retrieval fixture 83.3% Hit@k
Comparative eval 27-scenario / 69-query corpus 88.4% Hit@k, 76.8% exact support, 58.5 tokens/query
Query stress 40 adversarial retrieval-only cases 97.5% Hit@k, 97.5% exact support
Deduplication 22 cases (semi-semantic) 77.3% (17/22), zero false merges
Unit Tests Infrastructure & Logic 90+ passing tests

External Benchmarks

Benchmark Coverage Metric Status
LongMemEval 500 questions 97.4% R@5 Verified (Held-out split: 81.6% deterministic)
LoCoMo 1,986 items Pending Adapter implemented
ConvoMem 250 items Pending Adapter implemented
MemBench 8,500 items Pending Adapter implemented
  • Token efficiency: Waggle averages 58.5 tokens per retrieval vs 150.9 for naive chunked RAG.
  • Retrieval split: The flat slice (factual_recall, temporal_*) measures 85% / 85%; the graph slice (change, delta, synthesis, paraphrase) measures 93% / 70%.
  • Deduplication: Zero false-positive merges across the threshold sweep. Accuracy limited by conservative similarity bounds.

Detailed benchmark artifacts and the new Benchmark Methodology guide provide full traceability.


Reference & Docs

Detailed reference material lives in external documentation:


License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waggle_mcp-0.1.5.tar.gz (128.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waggle_mcp-0.1.5-py3-none-any.whl (117.4 kB view details)

Uploaded Python 3

File details

Details for the file waggle_mcp-0.1.5.tar.gz.

File metadata

  • Download URL: waggle_mcp-0.1.5.tar.gz
  • Upload date:
  • Size: 128.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for waggle_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 fd9c0b7b8190e078c8bbe291211278c4763c52f41389896e2b30b7b811daf2b7
MD5 4398bbab6f2ca6424f33244017728d6b
BLAKE2b-256 64031004c95ff8a60b033b95f46efe4fda4f23501d035ba2ecf45beb21a435c8

See more details on using hashes here.

File details

Details for the file waggle_mcp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: waggle_mcp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 117.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for waggle_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 04f5fe1b1db6dc507dd6ae67d05cfbff563bd29f61fb9af659df34ff984f5a2a
MD5 c7d5dc7b081fee9fc2bbbfb7b7cc26bd
BLAKE2b-256 f200c3aa43b3c6e17dc95abe0ba190eedcd940c458659965cee74861cc4ceb61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page