# snaven10/devctxengine architecture

> Architecture diagram of the GitHub repository snaven10/devctxengine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snaven10/devctxengine
- Repository: https://github.com/snaven10/devctxengine

## Overview

DevCtxEngine is a local-first code-context engine: the CLI initializes projects, indexes repository changes into semantic data, then exposes search and memory workflows through MCP, HTTP, and a terminal UI. The README documents the indexing stages and cross-project central store; sampled files show parts of the pipeline, storage, and server boundaries. Some links to major but unsampled capabilities are documented rather than source-verified, so those edges cite the README.

Main entry points: [`crates/devctx-cli/src/main.rs`](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-cli/src/main.rs) (DevCtx CLI), [`crates/devctx-index/src/pipeline.rs`](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-index/src/pipeline.rs) (Incremental indexer), [`crates/devctx-search/src/lib.rs`](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-search/src/lib.rs) (Hybrid search), [`crates/devctx-mcp/src/state.rs`](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-mcp/src/state.rs) (Tool execution state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Project workflow"]
  node_cli["DevCtx CLI<br/>[main.rs]"]
end

subgraph group_indexing["Code indexing"]
  node_indexer["Incremental indexer<br/>[pipeline.rs]"]
  node_git["Git change detection<br/>[git.rs]"]
  node_parser["Language parser<br/>[parser.rs]"]
  node_chunker["Code chunking<br/>[chunker.rs]"]
  node_embedder["Embedding providers<br/>[provider.rs]"]
  node_store[("DuckDB vector store<br/>[store.rs]")]
end

subgraph group_memory["Search and memory"]
  node_search["Hybrid search<br/>[lib.rs]"]
  node_reranker["Search reranking<br/>[provider.rs]"]
  node_summarizer["Content summaries<br/>[provider.rs]"]
  node_memory_engine["Memory engine<br/>[links.rs]"]
end

subgraph group_serving["Agent interfaces"]
  node_mcp["MCP tool server<br/>[backend.rs]"]
  node_mcp_state["Tool execution state<br/>[state.rs]"]
  node_http["HTTP API<br/>[lib.rs]"]
  node_tui["Terminal UI<br/>[lib.rs]"]
end

subgraph group_shared["Shared services"]
  node_central_client["Central-store client<br/>[client.rs]"]
  node_central_api["Central HTTP API<br/>[central.rs]"]
  node_central_db[("Central registry and memories<br/>[paths.rs]")]
end

node_engineer(("Engineer or agent"))

node_engineer -->|"runs commands"| node_cli
node_cli -->|"starts indexing"| node_indexer
node_indexer -->|"checks changes"| node_git
node_indexer -->|"parses files"| node_parser
node_indexer -->|"creates chunks"| node_chunker
node_indexer -->|"embeds chunks"| node_embedder
node_indexer -->|"writes index"| node_store
node_engineer -->|"searches code"| node_cli
node_cli -->|"requests search"| node_search
node_search -.->|"searches vectors"| node_store
node_search -.->|"reranks results"| node_reranker
node_search -.->|"summarizes content"| node_summarizer
node_engineer -->|"manages memories"| node_cli
node_cli -->|"remembers or recalls"| node_memory_engine
node_memory_engine -->|"stores memories"| node_store
node_engineer -->|"connects by MCP"| node_mcp
node_mcp -->|"dispatches tools"| node_mcp_state
node_mcp_state -.->|"runs search"| node_search
node_mcp_state -.->|"runs memory tools"| node_memory_engine
node_engineer -->|"uses HTTP API"| node_http
node_http -->|"delegates handlers"| node_mcp
node_engineer -->|"opens terminal UI"| node_tui
node_cli -->|"accesses shared store"| node_central_client
node_central_client -->|"sends requests"| node_central_api
node_central_api -.->|"serves shared data"| node_central_db

click node_cli "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-cli/src/main.rs"
click node_indexer "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-index/src/pipeline.rs"
click node_git "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-index/src/git.rs"
click node_parser "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-parse/src/parser.rs"
click node_chunker "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-chunk/src/chunker.rs"
click node_embedder "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-embed/src/provider.rs"
click node_store "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-store/src/store.rs"
click node_search "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-search/src/lib.rs"
click node_reranker "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-rerank/src/provider.rs"
click node_summarizer "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-summarize/src/provider.rs"
click node_memory_engine "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-memory/src/links.rs"
click node_mcp "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-mcp/src/backend.rs"
click node_mcp_state "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-mcp/src/state.rs"
click node_http "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-api/src/lib.rs"
click node_tui "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-tui/src/lib.rs"
click node_central_client "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-central/src/client.rs"
click node_central_api "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-api/src/central.rs"
click node_central_db "https://github.com/snaven10/devctxengine/blob/main/crates/devctx-central/src/paths.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli toneBlue
class node_indexer,node_git,node_parser,node_chunker,node_embedder,node_store toneAmber
class node_search,node_reranker,node_summarizer,node_memory_engine toneMint
class node_mcp,node_mcp_state,node_http,node_tui toneRose
class node_central_client,node_central_api,node_central_db,node_engineer toneIndigo
```

## Components

### Project workflow

- [DevCtx CLI](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-cli/src/main.rs): `crates/devctx-cli/src/main.rs`

### Code indexing

- [Incremental indexer](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-index/src/pipeline.rs): `crates/devctx-index/src/pipeline.rs`
- [Git change detection](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-index/src/git.rs): `crates/devctx-index/src/git.rs`
- [Language parser](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-parse/src/parser.rs): `crates/devctx-parse/src/parser.rs`
- [Code chunking](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-chunk/src/chunker.rs): `crates/devctx-chunk/src/chunker.rs`
- [Embedding providers](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-embed/src/provider.rs): `crates/devctx-embed/src/provider.rs`
- [DuckDB vector store](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-store/src/store.rs): `crates/devctx-store/src/store.rs`

### Search and memory

- [Hybrid search](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-search/src/lib.rs): `crates/devctx-search/src/lib.rs`
- [Search reranking](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-rerank/src/provider.rs): `crates/devctx-rerank/src/provider.rs`
- [Content summaries](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-summarize/src/provider.rs): `crates/devctx-summarize/src/provider.rs`
- [Memory engine](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-memory/src/links.rs): `crates/devctx-memory/src/links.rs`

### Agent interfaces

- [MCP tool server](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-mcp/src/backend.rs): `crates/devctx-mcp/src/backend.rs`
- [Tool execution state](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-mcp/src/state.rs): `crates/devctx-mcp/src/state.rs`
- [HTTP API](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-api/src/lib.rs): `crates/devctx-api/src/lib.rs`
- [Terminal UI](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-tui/src/lib.rs): `crates/devctx-tui/src/lib.rs`

### Shared services

- [Central-store client](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-central/src/client.rs): `crates/devctx-central/src/client.rs`
- [Central HTTP API](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-api/src/central.rs): `crates/devctx-api/src/central.rs`
- [Central registry and memories](https://github.com/snaven10/devctxengine/blob/main/crates/devctx-central/src/paths.rs): `crates/devctx-central/src/paths.rs`

### Other components

- **Engineer or agent**

## Connections

- Engineer or agent → DevCtx CLI: runs commands (evidence: `README.md`)
- DevCtx CLI → Incremental indexer: starts indexing (evidence: `README.md`)
- Incremental indexer → Git change detection: checks changes (evidence: `crates/devctx-index/src/pipeline.rs`)
- Incremental indexer → Language parser: parses files (evidence: `README.md`)
- Incremental indexer → Code chunking: creates chunks (evidence: `crates/devctx-index/src/pipeline.rs`)
- Incremental indexer → Embedding providers: embeds chunks (evidence: `README.md`)
- Incremental indexer → DuckDB vector store: writes index (evidence: `README.md`)
- Engineer or agent → DevCtx CLI: searches code (evidence: `README.md`)
- DevCtx CLI → Hybrid search: requests search (evidence: `README.md`)
- Hybrid search → DuckDB vector store: searches vectors
- Hybrid search → Search reranking: reranks results
- Hybrid search → Content summaries: summarizes content
- Engineer or agent → DevCtx CLI: manages memories (evidence: `README.md`)
- DevCtx CLI → Memory engine: remembers or recalls (evidence: `README.md`)
- Memory engine → DuckDB vector store: stores memories
- Engineer or agent → MCP tool server: connects by MCP (evidence: `README.md`)
- MCP tool server → Tool execution state: dispatches tools (evidence: `crates/devctx-mcp/src/backend.rs`)
- Tool execution state → Hybrid search: runs search
- Tool execution state → Memory engine: runs memory tools
- Engineer or agent → HTTP API: uses HTTP API (evidence: `README.md`)
- HTTP API → MCP tool server: delegates handlers (evidence: `crates/devctx-api/src/lib.rs`)
- Engineer or agent → Terminal UI: opens terminal UI (evidence: `README.md`)
- DevCtx CLI → Central-store client: accesses shared store (evidence: `README.md`)
- Central-store client → Central HTTP API: sends requests (evidence: `crates/devctx-central/src/client.rs`)
- Central HTTP API → Central registry and memories: serves shared data
