Skip to main content
Glama

Keep the context, not just the conversation

Waggle is an open-source, local-first memory layer for AI agents. It stores project knowledge as a graph: what you decided, why it matters, what it depends on, and what has changed. Your next conversation can pick up from that context instead of starting over.

Use Waggle with your MCP client, inspect and edit memory in Graph Studio, or bring a portable memory graph into the browser workspace.

  • Continue across sessions. Recall project decisions, requirements, preferences, and open questions without repeatedly pasting context.

  • Understand the reasoning. Explore relationships, supporting evidence, contradictions, and the history behind a decision.

  • Keep control of corrections. In the WebMCP workspace, agents propose changes; humans approve the exact content before it becomes authoritative.

  • Take memory with you. Export and import .abhi files across supported workflows without tying your graph to one client.

  • Start locally. The default SQLite store lives on your machine. Local use does not require a Waggle account or an external database.

Related MCP server: Graphiti Knowledge Graph MCP Server

Quick Start

The Python package requires Python 3.11+ and pipx. On macOS, you can install pipx with brew install pipx; see the installation guide for client-specific options.

pipx install waggle-mcp
pipx ensurepath

Restart your terminal after the first pipx ensurepath, then run:

waggle-mcp setup --yes
waggle-mcp doctor

Restart your MCP client to load Waggle. Setup detects supported clients and writes their configuration; automatic memory behavior uses the client's installed hooks, skills, or project instructions.

To check continuity, ask your agent to remember a project decision, then open a fresh session in the same project and ask what was decided. Keep the same project identifier across sessions.

Choose your client

For clients that accept an mcpServers configuration:

{
  "mcpServers": {
    "waggle": {
      "command": "waggle-mcp",
      "args": ["serve", "--transport", "stdio"]
    }
  }
}

If the command is not found, run pipx ensurepath and reopen your terminal. Use the troubleshooting guide for installation, startup, and client connection issues.

How memory works

Waggle separates durable project knowledge from the model's context window. An agent retrieves relevant memory when needed and records meaningful outcomes for later conversations.

  1. Capture: record decisions, constraints, preferences, and supporting context.

  2. Connect: link related memories and preserve contradictions and updates.

  3. Recall: retrieve scoped context with evidence and provenance.

  4. Continue: use that context in another session or supported client.

The core MCP workflow uses prime_context to load project context, query_graph to retrieve relevant history, and observe_conversation to record durable outcomes. build_context assembles a compact context pack for a specific task. Tool availability alone does not make an agent use memory automatically; its hooks, skills, or instructions must call these tools.

See the tool reference and configuration reference for the full API and retrieval settings.

Graph Studio

Graph Studio makes project memory inspectable and editable. Browse nodes and relationships, add or remove graph content, inspect source evidence, and review how a memory changed over time.

The browser workspace provides focused views for project context, memories, proposals, and activity. Graph Studio provides the graph-level view of that server-backed memory; private browser imports remain in the workspace tab.

Open Graph Studio

WebMCP — memory in your browser

The Waggle workspace lets a human and a compatible browser agent work with the same project memory. Its WebMCP adapter registers page-level Site tools through document.modelContext.registerTool. This is separate from installing Waggle's MCP server or configuring a remote MCP connector.

Connect and use the workspace

  1. Open the workspace in ChatGPT's built-in browser using a model and account configuration that supports Site tools.

  2. In the address bar, check Site tools → Available site tools and confirm the five Waggle tools are available. Keep this workspace tab open while working with its memory.

  3. Explore the sample project or select Load private .abhi to work with your own graph.

  4. Ask for a project brief or recall a specific decision. On the hosted workspace, use project_id: waggle-webmcp, including after importing your own graph.

  5. To correct a memory, ask the agent to propose a replacement. Review it in Proposals, edit it if needed, and approve the exact value.

  6. Ask the agent to apply the approved proposal using only its actual proposal ID. Recall the decision again to confirm the result and inspect its history.

For example:

Call Waggle's get_project_brief with project_id "waggle-webmcp".
Use the returned memories to catch me up on this project.

If Site tools are unavailable, check the browser's permissions and configuration. If the browser blocks an apply call, you can use Apply approved change on the approved proposal and confirm the action yourself. This uses the same approval and freshness checks; it does not bypass browser safeguards.

Browser tools

Tool

What it does

get_project_brief

Returns the project's goal, current decisions, constraints, state, and open questions.

recall_memory

Finds current authoritative memories for a query, with supersession provenance when available.

propose_memory_change

Creates a pending correction for human review without changing authoritative memory.

apply_approved_memory_change

Applies the exact approved value using only a proposal ID.

load_abhi_for_session

Loads a portable graph into this browser tab and returns a brief.

Corrections you can review

flowchart LR
    A[Agent proposes a correction] --> B[Human reviews and approves]
    B --> C[Waggle checks approval and target version]
    C --> D[Approved value becomes authoritative]
    D --> E[Previous memory stays in history]

Approved content cannot be changed by the applying agent. If the target memory has changed since the proposal was created, the proposal is marked stale instead of overwriting newer information. Application preserves the previous memory and links it to the replacement with an updates edge.

These approval rules govern the WebMCP correction workflow. They are not a claim that every direct graph-editing or local MCP operation requires approval.

Bring your own memory

A .abhi file is Waggle's portable memory graph. The browser importer reads existing memories; it does not ingest a source repository to invent a project brief.

  1. Select Load private .abhi in the workspace.

  2. Choose an unencrypted schema 2.x file, up to 700 KiB compressed and 4 MiB expanded.

  3. Confirm the Private session graph indicator appears. Briefs, recall, proposals, and approvals now use that imported copy.

The import replaces this tab's active workspace; it does not merge with the sample graph, modify your original file, or affect another visitor.

You can also attach the file to a compatible chat and ask:

Use Waggle's load_abhi_for_session tool to load this .abhi file into
project "waggle-webmcp" for this session. Then call get_project_brief.

The agent must be able to read the attachment and provide its bytes as base64. The tool does not accept a local file path or download URL. Use the page's file picker if the chat cannot access the attachment.

See the portable memory format for archive structure and supported operations.

Your data and deployment options

Where you use Waggle

Where memory lives

Local MCP server

SQLite on your machine, at ~/.waggle/waggle.db by default.

Private browser import

This tab's sessionStorage; the importer does not upload the graph to Waggle's backend.

Hosted sample workspace

An isolated, temporary server-side sample project; not an account-based cloud backup.

Self-hosted remote MCP server

Your configured Neo4j backend and infrastructure.

Browser lifetime. Private imports survive page reloads, and browser session restoration can preserve them. Use the workspace's Reset Demo control to explicitly clear the private copy and return to the sample project. Closing a chat conversation alone is not a guaranteed deletion signal. Browser storage is not encrypted by the importer.

AI services. Attaching a file in chat shares it with that chat provider. Memory returned through tool calls is also shared with the requesting AI service. Local storage does not mean that model inputs stay on your device.

Hosted preview. The public workspace is for trying the browser experience, not durable production storage. Its free hosting can pause when idle, take time to wake, and lose sample state on restart or redeployment. Opening it does not connect to your local Waggle database. The included SQLite preview configuration stores disposable state under /tmp, caps admission at 128 sessions per database, and rejects new sessions at capacity without evicting existing ones.

Self-hosting. The browser preview's governance backend currently requires SQLite. Remote MCP hosting with Neo4j is a separate configuration, not a drop-in replacement for that browser workflow. For remote deployment, configure HTTPS, authentication, persistent storage, and backups. Read the production deployment guide, security model, and hardening checklist before exposing a server publicly.

Development

Waggle uses Python for the memory engine and MCP server, and React/Vite for Graph Studio and the browser workspace.

git clone https://github.com/Abhigyan-Shekhar/Waggle-mcp.git
cd Waggle-mcp
python -m venv .venv
source .venv/bin/activate
# Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"

WAGGLE_MODEL=deterministic pytest -q
ruff check src/ tests/
ruff format --check src/ tests/

On PowerShell, set $env:WAGGLE_MODEL="deterministic" before running pytest -q. Deterministic embeddings keep tests offline; use the normal embedding model when evaluating semantic retrieval.

For frontend changes:

npm ci --prefix apps/mcp/graph-ui
npm run test:unit --prefix apps/mcp/graph-ui
npm run build --prefix apps/mcp/graph-ui

Documentation and contributing

License

Waggle is open source under the Apache License 2.0.

Available Tools

41 tools
aggregate_graphA

Retrieve a broad set of nodes bypassing standard semantic limits, optimized for global aggregation and map-reduce tasks. Supports filtering by node_type and tags.

Inputs: tags, as_of, query, project, +6 more.

build_contextA

Recursively retrieves and compresses relevant Waggle memory for the current task, using graph, hybrid, transcript, update, and conflict-aware retrieval. Decomposes the query into targeted subqueries, expands the graph around key nodes, resolves contradictions and superseded memories, and returns a compact context pack under a configurable token budget. Aliases: recursive_context, assemble_context, rlm_context.

Inputs: query (required), mode, depth, project, +6 more.

canonicalize_nodeA

Manually merge multiple nodes into a single canonical node. All aliases from the merged nodes flow into the canonical node's aliases. All edges pointing to/from merged nodes are re-pointed to the canonical node. Merged nodes are deleted. Idempotent: merging an already-merged node is a no-op. Use this after reviewing dedup_candidates to resolve ambiguous duplicates.

Inputs: node_ids (required), canonical_id (required), project, agent_id, +1 more.

clear_allA

Delete all graph memory data for the current tenant. Requires confirm=true. This does not remove API keys or tenant metadata.

Inputs: confirm, dry_run.

clear_projectA

Delete all memory data for one project/repository, including nodes, transcripts, repos, context windows, and connected edges. Requires confirm=true.

Inputs: project (required), confirm, dry_run.

clear_sessionA

Delete all memory data for one session/context window stream, including nodes, transcripts, context windows, and connected edges. Requires confirm=true.

Inputs: session_id (required), confirm, dry_run.

close_context_windowA

Close a context window, recompute its final graph embedding, refresh node counts, and derive cross-window edges. Use when a chat/session is complete.

Inputs: window_id (required).

commitA

Snapshot the current memory graph to a portable file (waggle commit). Exports a JSON backup for migration, restore drills, or offline archive. Use commit_format='abhi' (default) for a full .abhi export, or 'backup' for a raw JSON backup. Returns the output path, schema version, and object counts.

Inputs: mode, force, query, format, +13 more.

debug_retrievalA

Diagnose memory retrieval ranking for a query. Returns query embedding preview, context-window routing scores, selected windows, flat top nodes, and tiered top nodes for comparison.

Inputs: query (required), project, agent_id, max_depth, +3 more.

decompose_and_storeA

Break long or complex content into atomic memory nodes, store them automatically, and create inferred edges. Use for notes, summaries, or multi-fact passages. Returns the stored subgraph.

Inputs: content (required), context.

dedup_candidatesA

Return pairs of nodes whose embeddings are above a threshold but below the auto-merge threshold. Intended for human review before calling canonicalize_node. Returns pairs sorted by descending similarity so the most likely duplicates appear first.

Inputs: project, agent_id, threshold, session_id.

delete_nodeA

Delete a node and all connected edges from persistent memory.

Inputs: node_id (required).

diffB

Compare two .abhi memory files (waggle diff). Reports structural graph changes — added/removed/updated nodes and edges — plus lightweight semantic changes. The output is the screenshot that goes on the homepage.

Inputs: input_path_a (required), input_path_b (required).

edge_quality_reportA

Audit the quality of relationship edges in the memory graph. Returns counts per edge type, average edge_confidence per type, and the top-10 highest- and lowest-confidence edges for each type. Useful for diagnosing graph health and identifying noisy RELATES_TO edges.

Inputs: project, agent_id, session_id.

export_graph_htmlA

Export the current memory graph as an interactive HTML visualization. Use when a human needs to inspect the graph visually. Returns the output path and graph counts.

Inputs: output_path, include_physics.

export_markdown_vaultA

Export the current graph as an Obsidian-compatible Markdown vault. Use when a human wants browsable note files with graph links. Returns written files and graph counts.

Inputs: root_path (required), project, agent_id, session_id.

fsckA

Validate an .abhi memory file without importing it (waggle fsck). Verifies integrity hash, schema compliance, and constraint satisfaction. Like git fsck — run this before trusting a file you received.

Inputs: input_path (required).

get_context_windowA

Inspect one context window, including its nodes and links to other context windows. Use when auditing what a conversation/session contributed to memory.

Inputs: window_id (required), include_nodes.

get_node_historyA

Inspect one memory node's evidence, validity window, and connected context. Use when auditing why a memory exists or how it changed. Returns the node, evidence records, related nodes, and edges.

Inputs: node_id (required), max_depth.

get_statsA

Return high-level statistics about the current memory graph. Use for health checks or quick summaries. Returns node and edge counts, node type breakdowns, and recent or highly connected nodes.

Inputs: no named parameters.

get_topicsA

Detect topic clusters in the graph using community detection. Use to understand the main themes in memory. Returns labeled clusters with representative nodes and tags. Note: scope filtering (project, agent_id, session_id) is optional and silently ignored — topic detection always runs across the full tenant graph.

Inputs: project, agent_id, session_id.

graph_diffA

Show what changed in the memory graph recently, including added nodes, updated nodes, created edges, and contradiction edges. Use for review or handoff. Returns a serialized graph diff.

Inputs: since.

grepB

Execute a saved or ad hoc query against an .abhi file (waggle grep). Triggers the file's on_query event actions and returns matching nodes.

Inputs: input_path (required), query_id, query_text.

import_markdown_vaultA

Import an Obsidian-compatible Markdown vault into the current graph non-destructively. Use to sync edited vault notes back into memory. Returns created, updated, deleted-edge, and conflict counts.

Inputs: root_path (required).

list_conflictsA

List contradiction and update edges, with unresolved conflicts shown by default. Use to review memory disagreements before resolving them. Returns conflict entries with source and target nodes.

Inputs: limit, include_resolved.

list_context_scopesA

List known agent, project, and session scope values stored in the current tenant graph. Use before filtering memory by scope. Returns arrays of scope identifiers.

Inputs: no named parameters.

list_context_windowsA

List context windows for a project. Use to inspect chat/session-level memory containers, their status, node counts, and update times.

Inputs: limit, status, project.

load_abhi_chunksB

Load only selected or query-relevant chunks from an .abhi file for partial graph inspection.

Inputs: input_path (required), query_id, chunk_ids, query_text.

mergeA

Three-way merge branching .abhi memory files (waggle merge). Merges left and right branches against a common base into one output file. Conflicts surface as CONTRADICTS edges — nobody else can do this. Use --merge-strategy to control winner selection when both sides changed the same object.

Inputs: output_path (required), base_input_path (required), left_input_path (required), right_input_path (required), +1 more.

observe_conversationA

Automatically observe a completed user-assistant turn. ALWAYS persists the verbatim turn first. Then runs extraction (graph inference) as optional enrichment. If extraction fails, the verbatim turn is still stored. Use after turns containing preferences, decisions, constraints, requirements, corrections, project facts, or meaningful task outcomes. Do not ask the user to trigger this. Returns: turn_id, verbatim_stored (bool), nodes_extracted (count), edges_inferred (count), extraction_errors (non-fatal). Required fields: 'user_message' (the user's text) and 'assistant_response' (the assistant's reply). Do NOT use 'user_text' or 'assistant_text' — those field names are not accepted.

Inputs: user_message (required), assistant_response (required), project, agent_id, +1 more.

prime_contextA

Automatically build a compact context brief at the start of a scoped conversation or before work that needs continuity. Use to hydrate an assistant with the most relevant scoped memories. Returns summary text plus nodes and edges.

Inputs: project, agent_id, session_id.

pullB

Load a memory file into the current graph (waggle pull). Accepts a .abhi file (default) or a raw JSON backup. Runs integrity verification, schema validation, and constraint checks before merging. Returns counts for created and updated nodes and edges.

Inputs: input_path (required), pull_format.

query_graphA

Automatically search the memory graph before answering questions that may depend on prior context, user preferences, project decisions, constraints, or earlier conversation state. Returns a serialized subgraph with matching nodes and their connected neighborhood. Uses hybrid retrieval (transcript + graph) by default for robust fallback. Understands temporal references such as 'recently', 'latest', 'originally', and 'last week'. Benchmark modes: use retrieval_mode='graph' for graph-only (no verbatim fallback), 'verbatim' for transcript-only.

Inputs: query (required), as_of, project, agent_id, +6 more.

resolve_conflictA

Mark a contradiction or update edge as resolved without deleting the underlying history. Use after deciding how competing memories should be interpreted. Returns the resolved conflict entry. When winner is provided and the edge is CONTRADICTS or UPDATES, the losing node's valid_to is set to now, excluding it from future default queries.

Inputs: edge_id (required), winner, resolution_note.

showA

Inspect an .abhi memory file without loading it into the graph (waggle show). Returns summary stats, node/edge type breakdowns, and metadata counts. Like git show — quick read-only inspection of a commit object.

Inputs: input_path (required).

store_edgeA

Create a relationship between two stored nodes. Use this immediately after storing related nodes so the memory graph preserves structure, updates, and conflicts.

Inputs: source_id (required), target_id (required), relationship (required), weight.

store_nodeB

Store a piece of knowledge as a node in the persistent memory graph. Call this whenever you learn something important from the user: facts, preferences, decisions, entities, concepts, or questions. Prefer atomic facts.

Inputs: label (required), content (required), node_type (required), tags, +4 more.

timelineA

Build a chronological view of memory changes for a node, a query result, or the whole tenant. Use when order and evidence matter. Returns timestamped timeline items.

Inputs: limit, query, node_id, max_depth, +1 more.

update_nodeA

Update an existing memory node's content, label, or tags. Use when a stored memory needs correction without deleting its identity. Returns the updated node.

Inputs: node_id (required), tags, label, content.

window_graph_vizA

Export the context-window graph as an interactive HTML visualization. Each node is a chat/session window and edges show overlap, supersession, temporal order, or shared scope.

Inputs: project, output_path, include_physics.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 41 tools

    Disambiguation3/5

    Several tools have overlapping purposes: query_graph, aggregate_graph, get_related, build_context, and prime_context all retrieve memory context, differing mainly in scope and compression. Similarly, export_graph_html, window_graph_viz, and export_markdown_vault all export visualizations, and commit/pull/diff/merge/grep/show/fsck/load_abhi_chunks form a file-management cluster that may confuse agents. However, many tools are distinct (store_node, store_edge, delete_node, resolve_conflict).

    Naming Consistency3/5

    Most tools use verb_noun snake_case (store_node, delete_node, list_conflicts, resolve_conflict), but there are deviations: 'pull', 'diff', 'merge', 'grep', 'show', 'fsck' are bare git-like verbs, and 'timeline' is a noun. The mixed conventions are readable but not fully consistent.

    Tool Count2/5

    41 tools is excessive for a memory-graph MCP server. While the domain is broad (graph CRUD, context windows, file import/export, file format utilities), many tools could be consolidated (e.g., multiple export variants, multiple retrieval modes, multiple .abhi file inspection commands). The count feels heavy and will overwhelm agents.

    Completeness4/5

    The tool surface covers the full memory lifecycle: create/read/update/delete nodes and edges, conflict detection/resolution, context window management, import/export, backup/restore, and diagnostics. Minor gaps exist (e.g., no explicit edge update tool, no batch delete except clear_*), but the domain is thoroughly covered.

    Maintenance

    ActivityActive
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers