# memrohq/memro architecture

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

- Interactive diagram: https://gitdiagram.com/memrohq/memro
- Repository: https://github.com/memrohq/memro

## Overview

Memro is a shared memory and rules service for AI coding agents. Its local-first workflow captures durable rules into a repository and installs agent hooks so they are surfaced and checked during sessions; connecting adds shared memory, search, coordination, and integrations through the API. Agents can access the service through MCP, SDKs, and CLI-configured clients, while users manage memories and integrations in the dashboard. The server also ingests external sources and provides memory search and graph capabilities. Several subsystem links below are documented rather than source-verified; those use the README as evidence.

Main entry points: [`server/internal/api/server.go`](https://github.com/memrohq/memro/blob/main/server/internal/api/server.go) (HTTP API), [`apps/dashboard/src/App.jsx`](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/App.jsx) (Dashboard shell), [`mcp/src/memro_mcp/server.py`](https://github.com/memrohq/memro/blob/main/mcp/src/memro_mcp/server.py) (MCP server), [`server/internal/engine/engine.go`](https://github.com/memrohq/memro/blob/main/server/internal/engine/engine.go) (Memory engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent_access["Agent access"]
  node_cli["CLI commands<br/>[cli.js]"]
  node_client_config["Client setup<br/>[clients.js]"]
  node_agent_hooks["Agent hooks<br/>[hook.js]"]
  node_mcp_tools["MCP tools"]
  node_mcp_server["MCP server<br/>[server.py]"]
  node_python_sdk["Python SDK<br/>[client.py]"]
  node_js_sdk["JavaScript SDK<br/>[client.ts]"]
  node_go_sdk["Go SDK<br/>[client.go]"]
end

subgraph group_memory_service["Memory service"]
  node_api["HTTP API<br/>[server.go]"]
  node_api_handlers["Memory handlers<br/>[handlers_engine.go]"]
  node_engine["Memory engine<br/>[engine.go]"]
  node_store["Persistence<br/>[store.go]"]
  node_postgres[("PostgreSQL")]
  node_embedding["Embeddings<br/>[embed.go]"]
  node_indexer["Memory indexing<br/>[indexer.go]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Dashboard shell<br/>[App.jsx]"]
  node_dashboard_api["Dashboard API client<br/>[api.js]"]
  node_dashboard_memory["Memory views<br/>[Memories.jsx]"]
  node_dashboard_search["Search view<br/>[Search.jsx]"]
  node_dashboard_graph["Memory graph<br/>[Graph.jsx]"]
  node_dashboard_admin["Admin console<br/>[Admin.jsx]"]
  node_dashboard_connect["Connect view<br/>[Connect.jsx]"]
end

subgraph group_connectors["Integrations"]
  node_connector_manager["Connector ingestion<br/>[ingest.go]"]
  node_connector_catalog["Connector providers<br/>[catalog.go]"]
  node_claude_hook["Claude session hook<br/>[session-start.mjs]"]
  node_vscode["VS Code integration<br/>[extension.ts]"]
  node_acode["Acode integration<br/>[index.js]"]
end

node_developer(("Developer"))
node_agent(("AI agent"))

node_developer -->|"configures"| node_cli
node_cli -->|"dispatches setup"| node_client_config
node_client_config -->|"installs hooks"| node_agent_hooks
node_agent -->|"starts session"| node_agent_hooks
node_agent -->|"uses tools"| node_mcp_server
node_mcp_server -->|"registers tools"| node_mcp_tools
node_mcp_server -->|"calls API"| node_api
node_python_sdk -->|"calls API"| node_api
node_js_sdk -->|"calls API"| node_api
node_go_sdk -->|"calls API"| node_api
node_api -->|"routes requests"| node_api_handlers
node_api_handlers -->|"searches memories"| node_engine
node_engine -->|"queries memory data"| node_postgres
node_engine -.->|"creates embeddings"| node_embedding
node_indexer -->|"invalidates cache"| node_engine
node_indexer -.->|"indexes memories"| node_store
node_store -->|"persists records"| node_postgres
node_developer -->|"manages memory"| node_dashboard_app
node_dashboard_app -->|"loads data"| node_dashboard_api
node_dashboard_api -->|"sends HTTP requests"| node_api
node_dashboard_app -->|"renders view"| node_dashboard_memory
node_dashboard_app -->|"renders view"| node_dashboard_search
node_dashboard_app -->|"renders view"| node_dashboard_graph
node_dashboard_app -->|"renders console"| node_dashboard_admin
node_dashboard_app -->|"renders view"| node_dashboard_connect
node_api -.->|"configures connectors"| node_connector_catalog
node_connector_catalog -.->|"dispatches ingestion"| node_connector_manager
node_connector_manager -.->|"writes memories"| node_store
node_connector_manager -.->|"invalidates index"| node_indexer
node_claude_hook -.->|"connects session"| node_mcp_server
node_vscode -.->|"uses service"| node_api
node_acode -.->|"uses service"| node_api

click node_cli "https://github.com/memrohq/memro/blob/main/cli/src/cli.js"
click node_client_config "https://github.com/memrohq/memro/blob/main/cli/src/clients.js"
click node_agent_hooks "https://github.com/memrohq/memro/blob/main/cli/src/hook.js"
click node_mcp_tools "https://github.com/memrohq/memro/blob/main/mcp/src/memro_mcp/supermemory_tools.py"
click node_mcp_server "https://github.com/memrohq/memro/blob/main/mcp/src/memro_mcp/server.py"
click node_python_sdk "https://github.com/memrohq/memro/blob/main/sdk/python/src/memro/client.py"
click node_js_sdk "https://github.com/memrohq/memro/blob/main/sdk/js/src/client.ts"
click node_go_sdk "https://github.com/memrohq/memro/blob/main/sdk/go/client.go"
click node_api "https://github.com/memrohq/memro/blob/main/server/internal/api/server.go"
click node_api_handlers "https://github.com/memrohq/memro/blob/main/server/internal/api/handlers_engine.go"
click node_engine "https://github.com/memrohq/memro/blob/main/server/internal/engine/engine.go"
click node_store "https://github.com/memrohq/memro/blob/main/server/internal/store/store.go"
click node_embedding "https://github.com/memrohq/memro/blob/main/server/internal/embed/embed.go"
click node_indexer "https://github.com/memrohq/memro/blob/main/server/internal/indexer/indexer.go"
click node_dashboard_app "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/App.jsx"
click node_dashboard_api "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/lib/api.js"
click node_dashboard_memory "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Memories.jsx"
click node_dashboard_search "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Search.jsx"
click node_dashboard_graph "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Graph.jsx"
click node_dashboard_admin "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Admin.jsx"
click node_dashboard_connect "https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Connect.jsx"
click node_connector_manager "https://github.com/memrohq/memro/blob/main/server/internal/connectors/ingest.go"
click node_connector_catalog "https://github.com/memrohq/memro/blob/main/server/internal/connectors/catalog.go"
click node_claude_hook "https://github.com/memrohq/memro/blob/main/integrations/claude-code/hooks/session-start.mjs"
click node_vscode "https://github.com/memrohq/memro/blob/main/integrations/vscode/src/extension.ts"
click node_acode "https://github.com/memrohq/memro/blob/main/integrations/acode/index.js"

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,node_client_config,node_agent_hooks,node_mcp_tools,node_mcp_server,node_python_sdk,node_js_sdk,node_go_sdk toneBlue
class node_api,node_api_handlers,node_engine,node_store,node_postgres,node_embedding,node_indexer toneAmber
class node_dashboard_app,node_dashboard_api,node_dashboard_memory,node_dashboard_search,node_dashboard_graph,node_dashboard_admin,node_dashboard_connect toneMint
class node_connector_manager,node_connector_catalog,node_claude_hook,node_vscode,node_acode toneRose
class node_developer,node_agent toneIndigo
```

## Components

### Agent access

- [CLI commands](https://github.com/memrohq/memro/blob/main/cli/src/cli.js): `cli/src/cli.js`
- [Client setup](https://github.com/memrohq/memro/blob/main/cli/src/clients.js): `cli/src/clients.js`
- [Agent hooks](https://github.com/memrohq/memro/blob/main/cli/src/hook.js): `cli/src/hook.js`
- [MCP tools](https://github.com/memrohq/memro/blob/main/mcp/src/memro_mcp/supermemory_tools.py): `mcp/src/memro_mcp/supermemory_tools.py`
- [MCP server](https://github.com/memrohq/memro/blob/main/mcp/src/memro_mcp/server.py): `mcp/src/memro_mcp/server.py`
- [Python SDK](https://github.com/memrohq/memro/blob/main/sdk/python/src/memro/client.py): `sdk/python/src/memro/client.py`
- [JavaScript SDK](https://github.com/memrohq/memro/blob/main/sdk/js/src/client.ts): `sdk/js/src/client.ts`
- [Go SDK](https://github.com/memrohq/memro/blob/main/sdk/go/client.go): `sdk/go/client.go`

### Memory service

- [HTTP API](https://github.com/memrohq/memro/blob/main/server/internal/api/server.go): `server/internal/api/server.go`
- [Memory handlers](https://github.com/memrohq/memro/blob/main/server/internal/api/handlers_engine.go): `server/internal/api/handlers_engine.go`
- [Memory engine](https://github.com/memrohq/memro/blob/main/server/internal/engine/engine.go): `server/internal/engine/engine.go`
- [Persistence](https://github.com/memrohq/memro/blob/main/server/internal/store/store.go): `server/internal/store/store.go`
- **PostgreSQL**
- [Embeddings](https://github.com/memrohq/memro/blob/main/server/internal/embed/embed.go): `server/internal/embed/embed.go`
- [Memory indexing](https://github.com/memrohq/memro/blob/main/server/internal/indexer/indexer.go): `server/internal/indexer/indexer.go`

### Dashboard

- [Dashboard shell](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/App.jsx): `apps/dashboard/src/App.jsx`
- [Dashboard API client](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/lib/api.js): `apps/dashboard/src/lib/api.js`
- [Memory views](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Memories.jsx): `apps/dashboard/src/views/Memories.jsx`
- [Search view](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Search.jsx): `apps/dashboard/src/views/Search.jsx`
- [Memory graph](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Graph.jsx): `apps/dashboard/src/views/Graph.jsx`
- [Admin console](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Admin.jsx): `apps/dashboard/src/views/Admin.jsx`
- [Connect view](https://github.com/memrohq/memro/blob/main/apps/dashboard/src/views/Connect.jsx): `apps/dashboard/src/views/Connect.jsx`

### Integrations

- [Connector ingestion](https://github.com/memrohq/memro/blob/main/server/internal/connectors/ingest.go): `server/internal/connectors/ingest.go`
- [Connector providers](https://github.com/memrohq/memro/blob/main/server/internal/connectors/catalog.go): `server/internal/connectors/catalog.go`
- [Claude session hook](https://github.com/memrohq/memro/blob/main/integrations/claude-code/hooks/session-start.mjs): `integrations/claude-code/hooks/session-start.mjs`
- [VS Code integration](https://github.com/memrohq/memro/blob/main/integrations/vscode/src/extension.ts): `integrations/vscode/src/extension.ts`
- [Acode integration](https://github.com/memrohq/memro/blob/main/integrations/acode/index.js): `integrations/acode/index.js`

### Other components

- **Developer**
- **AI agent**

## Connections

- Developer → CLI commands: configures (evidence: `README.md`)
- CLI commands → Client setup: dispatches setup (evidence: `cli/src/cli.js`)
- Client setup → Agent hooks: installs hooks (evidence: `cli/src/clients.js`)
- AI agent → Agent hooks: starts session (evidence: `README.md`)
- AI agent → MCP server: uses tools (evidence: `README.md`)
- MCP server → MCP tools: registers tools (evidence: `mcp/src/memro_mcp/server.py`)
- MCP server → HTTP API: calls API (evidence: `README.md`)
- Python SDK → HTTP API: calls API (evidence: `README.md`)
- JavaScript SDK → HTTP API: calls API (evidence: `README.md`)
- Go SDK → HTTP API: calls API (evidence: `README.md`)
- HTTP API → Memory handlers: routes requests (evidence: `server/internal/api/server.go`)
- Memory handlers → Memory engine: searches memories (evidence: `server/internal/api/handlers_engine.go`)
- Memory engine → PostgreSQL: queries memory data (evidence: `README.md`)
- Memory engine → Embeddings: creates embeddings
- Memory indexing → Memory engine: invalidates cache
- Memory indexing → Persistence: indexes memories
- Persistence → PostgreSQL: persists records (evidence: `README.md`)
- Developer → Dashboard shell: manages memory (evidence: `README.md`)
- Dashboard shell → Dashboard API client: loads data (evidence: `apps/dashboard/src/App.jsx`)
- Dashboard API client → HTTP API: sends HTTP requests (evidence: `apps/dashboard/src/lib/api.js`)
- Dashboard shell → Memory views: renders view (evidence: `apps/dashboard/src/App.jsx`)
- Dashboard shell → Search view: renders view (evidence: `apps/dashboard/src/App.jsx`)
- Dashboard shell → Memory graph: renders view (evidence: `apps/dashboard/src/App.jsx`)
- Dashboard shell → Admin console: renders console (evidence: `apps/dashboard/src/App.jsx`)
- Dashboard shell → Connect view: renders view (evidence: `apps/dashboard/src/App.jsx`)
- HTTP API → Connector providers: configures connectors
- Connector providers → Connector ingestion: dispatches ingestion
- Connector ingestion → Persistence: writes memories
- Connector ingestion → Memory indexing: invalidates index
- Claude session hook → MCP server: connects session
- VS Code integration → HTTP API: uses service
- Acode integration → HTTP API: uses service
