# opentech-lab/openmemory architecture

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

- Interactive diagram: https://gitdiagram.com/opentech-lab/openmemory
- Repository: https://github.com/opentech-lab/openmemory

## Overview

OpenMemory is a local-first memory and project-planning system for AI agents, exposed through an API, an MCP server, and a web dashboard. A typical user workflow is to capture durable information or project work, retrieve and organize it through memory and graph features, then use project, QA, design, and workflow tools to act on it. The README documents these capabilities, while sampled source confirms selected server modules and LLM integrations; many API-to-domain routes are not shown, so uncertain links are omitted.

Main entry points: [`apps/server/src/main.rs`](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/main.rs) (API server), [`apps/server/src/llm.rs`](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/llm.rs) (LLM providers), [`apps/web/app/(sidebar)`](https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/(sidebar)) (Web dashboard), [`apps/web/app/api`](https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/api) (Web API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_dashboard["Web dashboard"]
  node_web_api["Web API routes"]
  node_mcp_server["MCP tools"]
end

subgraph group_memory["Memory and knowledge"]
  node_memory_service["Persistent memory<br/>[memory.rs]"]
  node_memory_graph[("Temporal knowledge graph<br/>[falkordb.rs]")]
  node_environment["Encrypted settings<br/>[crypto.rs]"]
  node_resources["Resource catalog<br/>[resources.rs]"]
end

subgraph group_projects["Project workspace"]
  node_projects["Projects and tasks<br/>[planning_tools.rs]"]
  node_code_graph["Project code graphs<br/>[project_sync.rs]"]
  node_git["Source control<br/>[git_browser.rs]"]
  node_qa[("QA records and plans<br/>[qa.rs]")]
  node_qa_ingest["QA result ingest<br/>[qa_ingest.rs]"]
  node_design["Design workspace<br/>[design_ai.rs]"]
  node_design_blobs[("Design documents<br/>[design_blobs.rs]")]
  node_budgets[("Design budgets<br/>[design_budgets.rs]")]
  node_forecasts[("Cost forecasts<br/>[forecasts.rs]")]
  node_library[("Asset library<br/>[library.rs]")]
end

subgraph group_agent_tools["Agent tools"]
  node_workflows[("Reusable workflows<br/>[workflows.rs]")]
  node_sessions[("Agent sessions<br/>[session.rs]")]
end

subgraph group_platform["Server platform"]
  node_llm["LLM providers<br/>[llm.rs]"]
  node_api_server["API server<br/>[main.rs]"]
  node_postgres[("PostgreSQL")]
  node_opensearch[("OpenSearch")]
end

node_user(("User or agent"))
node_mcp_client(("MCP client"))
node_external_llm{{"Configured LLM provider"}}

node_user -->|"uses"| node_dashboard
node_user -->|"configures"| node_mcp_client
node_dashboard -.->|"requests data"| node_web_api
node_web_api -.->|"calls API"| node_api_server
node_mcp_client -->|"uses tools"| node_mcp_server
node_mcp_server -.->|"serves MCP"| node_api_server
node_api_server -.->|"handles memory"| node_memory_service
node_memory_service -.->|"retrieves graph"| node_memory_graph
node_api_server -->|"protects secrets"| node_environment
node_api_server -.->|"manages resources"| node_resources
node_api_server -->|"manages planning"| node_projects
node_api_server -->|"indexes projects"| node_code_graph
node_api_server -->|"serves source control"| node_git
node_api_server -->|"records QA"| node_qa
node_api_server -->|"ingests results"| node_qa_ingest
node_api_server -->|"assists design"| node_design
node_api_server -.->|"stores documents"| node_design_blobs
node_api_server -->|"manages budgets"| node_budgets
node_api_server -->|"uses forecasts"| node_forecasts
node_api_server -->|"manages assets"| node_library
node_api_server -->|"runs workflows"| node_workflows
node_api_server -->|"records sessions"| node_sessions
node_api_server -->|"calls providers"| node_llm
node_design -->|"generates designs"| node_llm
node_llm -->|"sends prompts"| node_external_llm
node_api_server -->|"persists records"| node_postgres
node_api_server -->|"searches content"| node_opensearch
node_qa_ingest -->|"records runs"| node_qa

click node_dashboard "https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/(sidebar)"
click node_web_api "https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/api"
click node_mcp_server "https://github.com/opentech-lab/openmemory/tree/main/apps/server/src/mcp_app"
click node_memory_service "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/mcp_app/memory.rs"
click node_memory_graph "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/falkordb.rs"
click node_environment "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/crypto.rs"
click node_resources "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/resources.rs"
click node_projects "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/mcp_app/planning_tools.rs"
click node_code_graph "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/project_sync.rs"
click node_git "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/git_browser.rs"
click node_qa "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/qa.rs"
click node_qa_ingest "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/qa_ingest.rs"
click node_design "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_ai.rs"
click node_design_blobs "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_blobs.rs"
click node_budgets "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_budgets.rs"
click node_forecasts "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/forecasts.rs"
click node_library "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/library.rs"
click node_workflows "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/workflows.rs"
click node_sessions "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/session.rs"
click node_llm "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/llm.rs"
click node_api_server "https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/main.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_dashboard,node_web_api,node_mcp_server,node_user,node_mcp_client toneBlue
class node_memory_service,node_memory_graph,node_environment,node_resources toneAmber
class node_projects,node_code_graph,node_git,node_qa,node_qa_ingest,node_design,node_design_blobs,node_budgets,node_forecasts,node_library toneMint
class node_workflows,node_sessions toneRose
class node_llm,node_api_server,node_postgres,node_opensearch,node_external_llm toneIndigo
```

## Components

### User interfaces

- [Web dashboard](https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/(sidebar)): `apps/web/app/(sidebar)`
- [Web API routes](https://github.com/opentech-lab/openmemory/tree/main/apps/web/app/api): `apps/web/app/api`
- [MCP tools](https://github.com/opentech-lab/openmemory/tree/main/apps/server/src/mcp_app): `apps/server/src/mcp_app`

### Memory and knowledge

- [Persistent memory](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/mcp_app/memory.rs): `apps/server/src/mcp_app/memory.rs`
- [Temporal knowledge graph](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/falkordb.rs): `apps/server/src/falkordb.rs`
- [Encrypted settings](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/crypto.rs): `apps/server/src/crypto.rs`
- [Resource catalog](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/resources.rs): `apps/server/src/resources.rs`

### Project workspace

- [Projects and tasks](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/mcp_app/planning_tools.rs): `apps/server/src/mcp_app/planning_tools.rs`
- [Project code graphs](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/project_sync.rs): `apps/server/src/project_sync.rs`
- [Source control](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/git_browser.rs): `apps/server/src/git_browser.rs`
- [QA records and plans](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/qa.rs): `apps/server/src/qa.rs`
- [QA result ingest](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/qa_ingest.rs): `apps/server/src/qa_ingest.rs`
- [Design workspace](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_ai.rs): `apps/server/src/design_ai.rs`
- [Design documents](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_blobs.rs): `apps/server/src/design_blobs.rs`
- [Design budgets](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/design_budgets.rs): `apps/server/src/design_budgets.rs`
- [Cost forecasts](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/forecasts.rs): `apps/server/src/forecasts.rs`
- [Asset library](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/library.rs): `apps/server/src/library.rs`

### Agent tools

- [Reusable workflows](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/workflows.rs): `apps/server/src/workflows.rs`
- [Agent sessions](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/session.rs): `apps/server/src/session.rs`

### Server platform

- [LLM providers](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/llm.rs): `apps/server/src/llm.rs`
- [API server](https://github.com/opentech-lab/openmemory/blob/main/apps/server/src/main.rs): `apps/server/src/main.rs`
- **PostgreSQL**
- **OpenSearch**

### Other components

- **User or agent**
- **MCP client**
- **Configured LLM provider**

## Connections

- User or agent → Web dashboard: uses
- User or agent → MCP client: configures
- Web dashboard → Web API routes: requests data
- Web API routes → API server: calls API
- MCP client → MCP tools: uses tools
- MCP tools → API server: serves MCP
- API server → Persistent memory: handles memory
- Persistent memory → Temporal knowledge graph: retrieves graph
- API server → Encrypted settings: protects secrets (evidence: `apps/server/src/main.rs`)
- API server → Resource catalog: manages resources (evidence: `apps/server/src/main.rs`)
- API server → Projects and tasks: manages planning
- API server → Project code graphs: indexes projects (evidence: `apps/server/src/main.rs`)
- API server → Source control: serves source control
- API server → QA records and plans: records QA (evidence: `apps/server/src/main.rs`)
- API server → QA result ingest: ingests results (evidence: `apps/server/src/qa_ingest.rs`)
- API server → Design workspace: assists design (evidence: `apps/server/src/main.rs`)
- API server → Design documents: stores documents (evidence: `apps/server/src/main.rs`)
- API server → Design budgets: manages budgets (evidence: `apps/server/src/main.rs`)
- API server → Cost forecasts: uses forecasts (evidence: `apps/server/src/main.rs`)
- API server → Asset library: manages assets (evidence: `apps/server/src/main.rs`)
- API server → Reusable workflows: runs workflows (evidence: `apps/server/src/main.rs`)
- API server → Agent sessions: records sessions
- API server → LLM providers: calls providers (evidence: `apps/server/src/main.rs`)
- Design workspace → LLM providers: generates designs (evidence: `apps/server/src/design_ai.rs`)
- LLM providers → Configured LLM provider: sends prompts (evidence: `apps/server/src/llm.rs`)
- API server → PostgreSQL: persists records
- API server → OpenSearch: searches content
- QA result ingest → QA records and plans: records runs (evidence: `apps/server/src/qa_ingest.rs`)
