SuperAPI AI Directory

Yggdrasil

Local-first memory for AI coding agents on SQLite/FTS5, curated and semantically de-duplicated, with data stored as plain rows you own.

Open website

About this tool

Yggdrasil is a local-first tool that provides persistent memory for AI coding agents, exposing memory capabilities to agents through MCP (Model Context Protocol). Its goal is to solve the problem that "every time a new session starts, the AI forgets the project context, and the user has to explain it repeatedly."

Purpose and Positioning

Yggdrasil provides a shared memory for agents in Claude Code, Codex, OpenCode, and any other MCP host: when a new session starts, no matter which tool or project is used, the agent can know the decisions made previously, the failures encountered, and the matters still pending. It is not itself an intelligent model, but a "memory + tools" layer, responsible for delivering the right memory to the agent at the right time; the intelligence still comes from the LLM used by the user.

Main Capabilities

  • Persistent memory: decisions, lessons learned, and project status can be retained across sessions.
  • One brain shared by multiple tools: Claude Code, Codex, OpenCode, and any MCP host share the same memory.
  • Cross-project recall: it can prompt "this looks like something you did in project B, do you want to reuse it?"
  • Carefully selected rather than fully captured: the agent saves only a few key items, and the governance mechanism handles deduplication and archiving, never deleting.
  • Optional self-maintenance: you can choose to let a small local model consolidate memory in the background, without consuming API tokens.
  • Unified identity: optionally set a name and persona so that all agents behave consistently.
  • 100% local: memory is stored on the local machine, with no cloud, no account, and no telemetry.

How to Use

Install in Claude Code with two commands (the plugin starts via uv):ygg install is a one-time guided setup that installs a resident background service, registers MCP tools with every agent host it detects (Claude Code, Codex, OpenCode), and recommends an optional local model when the hardware allows it (you can also choose not to install it to keep zero configuration). OpenCode must be installed first, then run ygg install(if it has already been set up, use ygg redeploy), and the entry will be written and merged into the existing opencode.json. If the tools do not appear, you can run ygg doctor to diagnose.

The engine starts lazily on first use and generates its own local token; no API key, no cloud, and no configuration are required. You can also try it with a one-off database:uvx --from yggdrasil-memory ygg serve --reset --db /tmp/ygg.sqlite. In daily use, you can say to the agent "recall what we decided about this project" or "remember this decision," and it can be recalled in the next session.

If you already have history, you can locally distill seed memories from existing Claude Code and Codex conversation records, Obsidian vaults, and CLAUDE.md repositories (ygg seed , etc.). To migrate from other memory tools, you can use ygg import --from mcp-memory --path memory.json to import (automatic deduplication, with key protection).

How It Works

Six MCP tools are visible to the agent: ygg_health, ygg_bootstrap, ygg_search, ygg_recall, ygg_remember, ygg_materialize, provided by the plugin or ygg install Automatic registration.

  • Resident daemon: a tiny local service (about 21 MB of memory), accessed by agents through MCP tools.
  • Hooks: at session start, automatically inject identity, project status, and to-dos (about 300 tokens); optional per-turn prompt hooks automatically recall memories relevant to the current request.
  • Ranking: pinned and frequently recalled memories surface first.
  • Governance: duplicates and conflicts enter a pending-review queue, and changes are non-destructive (archive rather than delete).
  • Obsidian: each memory is also a plain Markdown note, readable, editable, and greppable.

Memory tiers and optional models

By default it runs on SQLite + FTS5, with zero dependencies, instant keyword search, and no model downloads. Optional local models provide two independent tiers: embedding (semantic search) and background consolidation (small LLM). At runtime it is only responsible for computing vectors and running the background model; all memories and vectors are stored in the same local SQLite.ygg install It scans Ollama, LM Studio, and llama.cpp, asks whether to start installed but idle services, and presents a menu by task (green indicates a model is already available, red indicates a download is required); after selection it automatically writes embed_backend, embed_url, and distill_url.ygg recommend It can scan and view the directory without making changes.

It can also connect to an OpenAI-compatible /v1/embeddings service (such as llama.cpp's llama-server --embeddings, OpenRouter, LM Studio, vLLM); the key is stored in ~/.yggdrasil/embed_api_key (0600 permissions) and passed to the daemon as a file path, so it does not appear in ps, launchd plist, or systemd unit,ygg config list it redacts it.

The text also gives several wiring caveats: embed_url uses the /v1 base URL while distill_url uses the host root address, and swapping the two results in a 404; LM Studio's model id differs from the download name, so you should ask the server rather than guess; Just-In-Time model loading and starting the server at login need to be enabled; OpenRouter should use an inference key rather than a provisioning key, and note that privacy settings can filter models.

On quality trade-offs there is measured data: on a corpus of 232 memories and 110 queries, local paraphrase-multilingual has recall@1 of 0.964, slightly higher than the free hosted model's 0.946; larger vector dimensions are not necessarily more accurate (mxbai-embed-large 1024 dimensions 0.809, nomic-embed-text 768 dimensions 0.818), and what truly affects accuracy is whether the model supports your language—the two English models drop to 0.40–0.45 on cross-language queries, while the multilingual default model stays at 0.95.

The evaluation is produced by eval/ygg_eval.py: in-project retrieval (the common path) has recall@1 of 0.94 and recall@3 of 1.00; full-database unfiltered retrieval is harder (recall@1 0.72, recall@3 0.87). The zero-dependency lexical mode already handles keyword and code identifier queries (1.00), while local models add semantic and cross-language capability (cross-language 0.25 → 0.95). Full details are in BENCHMARKS.md, and you can use python3 eval/ygg_eval.py --report . Re-run.

Use cases

  • Developers who need to share project memory across multiple AI coding tools.
  • Users who value data privacy and want memory to remain entirely on the local machine or LAN.
  • Scenarios where long-term project context should persist across sessions, but the user does not want the context polluted by full-capture memory.
  • Users who need to distill seed memory from existing conversation records, Obsidian vaults, or CLAUDE.md repositories.
  • Scenarios where curated memory needs to be exported back to AGENTS.md / MEMORY.md so that new clones or collaborators without this tool can also gain context.

Limitations and status

The project is in Alpha, and the normal paths and governance loop already have gate tests (scripts/run_gates.sh), but it has not yet been hardened for multi-user or production environments. macOS is currently supported; the Linux/Windows service installers have been built and are in final real-device testing. The future roadmap includes cross-device sync, a relationship graph (SOLVES / SUPERSEDES / CONTRADICTS), and official Linux/Windows support. Writes are deliberate: retrieval is automatic, writes are explicitly invoked by the agent via ygg_remember, and there is no full capture. By default, pure lexical search is zero-dependency and immediately available, while semantic search is optional and requires a local Ollama model. When idle, the engine uses about 21 MB of memory and nearly 0% CPU, and disk usage is tens of KB per memory; about 300 tokens are injected at session start. Memories are materialized as Markdown notes in an Obsidian vault and can be edited or deleted like ordinary files; the engine never hard-deletes, but archives instead (reversible). The project is licensed under GNU AGPL v3.0, is free and open source, and can be self-hosted, modified, and redistributed, but if modified or provided as a network service, the source code must be released under the same license.

Details about cross-project recall, identity/persona configuration, LAN distillation servers, and comparisons with other memory tools (such as claude-mem, mem0, context-mode, and Context7) are all explained in the official materials and can be found in the repository documentation.