What Dewey Does

Dewey is a per-repository MCP server that provides AI agent personas with unified knowledge retrieval. It combines two complementary search modes into a single service:

  • Structured queries — keyword search, tag lookup, wikilink traversal, and property queries against a knowledge graph built from your repository’s Markdown files
  • Semantic queries — vector-based similarity search that finds conceptually related content even when different terminology is used

Together, these modes let agents start with a vague concept (“authentication timeout issues”) and progressively refine their understanding through structured navigation — discovering related specifications, past decisions, and connected documentation they did not know to ask for.

Dewey runs locally as an MCP server alongside your AI coding environment. It persists its indexes to a SQLite database (.uf/dewey/graph.db), so subsequent sessions load near-instantly from the persistent index instead of rebuilding from scratch. No data leaves your machine — the embedding model runs locally via Ollama.

The graphthulhu Relationship

Dewey is a hard fork of graphthulhu, an Obsidian-compatible MCP knowledge graph server created by Max Skridlevsky. Dewey preserves every MCP tool that graphthulhu exposes and adds:

  • Persistent storage — indexes survive across sessions instead of rebuilding from scratch
  • Semantic search — vector embeddings via locally-run Ollama models
  • Pluggable content sources — GitHub API, web crawl, and local disk (graphthulhu only indexes local Markdown)
  • Incremental updates — only changed files are re-indexed, not the entire corpus

Existing agent configurations that use graphthulhu can migrate to Dewey by changing the MCP server name in their configuration. No agent prompt changes are required for existing functionality.

Query Capabilities

Dewey exposes 48 MCP tools across 12 categories. For knowledge retrieval, agents primarily use 9 query tools across two search modes.

Structured Queries

Inherited from graphthulhu, these tools provide precise, deterministic retrieval:

ToolWhat It Does
searchFull-text keyword search across all indexed content
find_by_tagFind pages by tag values with child tag hierarchy support
query_propertiesStructured queries against YAML frontmatter properties (eq, contains, gt, lt)
get_pageRetrieve the full block tree of a specific document
traverseFollow wikilinks to discover relationships between documents via BFS path-finding
find_connectionsDiscover direct links, shortest paths, and shared connections between pages

Semantic Queries

New in Dewey, these tools use vector embeddings for conceptual similarity:

ToolWhat It Does
dewey_semantic_searchFind documents semantically similar to a natural language query, ranked by cosine similarity
dewey_similarGiven a document ID, find the most similar documents in the index
dewey_semantic_search_filteredSemantic search constrained by source type, repository, or property values

Knowledge Management

New in Dewey v3.0.0, these tools manage the knowledge lifecycle:

ToolWhat It Does
compileCluster stored learnings by topic and synthesize them into current-state articles via LLM
lintDetect quality issues: stale decisions, uncompiled learnings, embedding gaps, contradictions
promoteMove content between trust tiers (draft to validated to authored) after human review

Learning

These tools manage individual learnings and the index:

ToolWhat It Does
store_learningStore a learning with a required tag and optional category classification

Combined Queries

The most powerful retrieval pattern combines both modes:

  1. Semantic search to discover broadly relevant content: “authentication timeout issues”
  2. Property filter to narrow by source: source = "github" AND repo = "gaze"
  3. Graph traversal to explore relationships: follow wikilinks from the discovered documents to find connected specifications

This pattern enables agents to start with a vague concept and progressively refine their understanding through structured navigation.

Content Sources

Dewey indexes content from four pluggable source types. Each source implements a common interface, so adding new source types (Confluence, Notion, S3) is a matter of implementing the interface — not modifying core indexing logic.

Local Disk

The foundational source, inherited from graphthulhu. Indexes all Markdown files in the repository, including hidden directories (.opencode/, .specify/, .uf/muti-mind/). Files are watched for changes in real time via fsnotify — when you save a file, Dewey re-indexes only the changed content using SHA-256 content hashing for change detection.

GitHub API

Fetches issues, pull requests, READMEs, and documentation directories from whitelisted repositories in your GitHub organization. This provides cross-repository context that is impossible with a single-repo knowledge graph. Authentication uses the gh CLI’s existing credentials.

Web Crawl

Fetches and indexes documentation from toolstack websites — Go standard library docs, framework documentation, tool references. Crawls respect robots.txt, impose configurable rate limiting, and cache content locally. HTML is converted to Markdown for consistent indexing.

Code

Go AST parsing extracts function signatures, CLI commands, MCP tool registrations, and package documentation directly from Go source files. This gives agents access to the actual API surface of Go projects without relying on external documentation. Code sources are configured in sources.yaml with the type code and a path to the Go module root.

See the getting-started guide for YAML configuration examples for each source type.

Embedding Model

Dewey uses IBM Granite Embedding for vector embeddings — a 63 MB model that runs locally via Ollama.

AttributeValue
DeveloperIBM Research
LicenseApache 2.0
Training dataPermissibly licensed public datasets with full transparency
Model size30M parameters (63 MB)
Context window512 tokens
Load time1-2 seconds on Apple Silicon
Embedding speed~10-50 ms per chunk

Enterprise licensing provenance matters. Granite’s training data is fully disclosed and permissibly licensed — there are no questions about whether the model was trained on proprietary or restricted content. This is a deliberate choice for organizations where licensing provenance is a compliance requirement.

The embedding model is configurable. While Granite is the recommended default, teams can swap to any Ollama-compatible embedding model by editing .uf/dewey/config.yaml:

embedding:
  provider: ollama
  model: granite-embedding:30m
  # Alternative: granite-embedding:278m for multilingual content

How Heroes Use Dewey

Every hero in the swarm benefits from Dewey, but in different ways. Dewey is always optional — all heroes function without it, falling back to direct file reads and CLI queries.

HeroRoleHow They Use Dewey
Muti-MindProduct OwnerAutonomous specification drafting (retrieve context, draft spec, self-clarify, validate against history), cross-repo issue discovery, backlog pattern analysis
Cobalt-CrushDeveloperToolstack API documentation, implementation patterns from other repos, related spec artifacts
GazeTesterQuality patterns across repos, CRAP score baselines, known failure modes for similar code
The DivisorReviewer CouncilConvention pack context enriched with framework docs, recurring review findings across the org
Mx FManagerCross-repo velocity trends, retrospective outcomes, coaching pattern discovery

Next Steps