# gajini-prasanth/memori architecture

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

- Interactive diagram: https://gitdiagram.com/gajini-prasanth/memori
- Repository: https://github.com/gajini-prasanth/memori

## Overview

Memori is a memory layer for LLM applications, available through Python and TypeScript SDKs and agent integrations. The main workflow attributes an interaction, captures conversation or execution data, stores structured memories, then retrieves relevant memories for later model requests. The Rust core supplies shared augmentation, embedding, retrieval, and worker capabilities; storage can be host-provided or cloud-backed. The README documents OpenClaw, Hermes, and MCP integration capabilities. Some integration internals and unsampled modules are represented at directory level; edges are limited to README statements and indexed source references.

Main entry points: [`core/src/lib.rs`](https://github.com/gajini-prasanth/memori/blob/main/core/src/lib.rs) (Shared Rust engine), [`memori/__init__.py`](https://github.com/gajini-prasanth/memori/blob/main/memori/__init__.py) (Python SDK), [`memori/_network.py`](https://github.com/gajini-prasanth/memori/blob/main/memori/_network.py) (Memori Cloud API), [`core/src/retrieval/pipeline.rs`](https://github.com/gajini-prasanth/memori/blob/main/core/src/retrieval/pipeline.rs) (Recall and ranking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDKs and API"]
  node_python["Python SDK<br/>[__init__.py]"]
  node_ts["TypeScript SDK<br/>[memori.ts]"]
  node_attribution["Attribution and config<br/>[_config.py]"]
  node_llm_adapters["LLM adapters"]
end

subgraph group_memory["Memory processing"]
  node_capture["Conversation capture<br/>[_manager.py]"]
  node_augmentation["Advanced augmentation<br/>[_manager.py]"]
  node_rust_engine["Shared Rust engine<br/>[lib.rs]"]
  node_augment_pipeline["Augmentation pipeline<br/>[pipeline.rs]"]
  node_worker["Background workers<br/>[worker.rs]"]
  node_embedding["Embeddings<br/>[api.rs]"]
end

subgraph group_data["Retrieval and storage"]
  node_retrieval["Recall and ranking<br/>[pipeline.rs]"]
  node_search["Lexical and similarity search"]
  node_storage["Storage managers<br/>[_manager.py]"]
  node_db_adapters["Database adapters and drivers"]
  node_cloud_api["Memori Cloud API<br/>[_network.py]"]
end

subgraph group_integrations["Agent integrations"]
  node_openclaw["OpenClaw plugin<br/>[index.ts]"]
  node_hermes["Hermes provider<br/>[__init__.py]"]
  node_mcp["MCP integration<br/>[index.ts]"]
end

node_developer(("Application developer"))
node_llm(("LLM provider"))

node_developer -->|"configures"| node_python
node_developer -->|"configures"| node_ts
node_python -->|"sets context"| node_attribution
node_python -->|"captures interactions"| node_capture
node_ts -->|"delegates memory work"| node_rust_engine
node_capture -->|"posts cloud messages"| node_cloud_api
node_capture -.->|"schedules memory work"| node_augmentation
node_augmentation -.->|"uses shared core"| node_rust_engine
node_rust_engine -->|"runs augmentation"| node_augment_pipeline
node_rust_engine -->|"starts jobs"| node_worker
node_augment_pipeline -->|"requests augmentation"| node_cloud_api
node_rust_engine -.->|"creates embeddings"| node_embedding
node_rust_engine -->|"runs recall"| node_retrieval
node_retrieval -->|"ranks candidates"| node_search
node_retrieval -->|"fetches candidates"| node_storage
node_storage -->|"selects drivers"| node_db_adapters
node_python -->|"recalls memories"| node_retrieval
node_llm_adapters -.->|"invokes model"| node_llm
node_python -->|"integrates providers"| node_llm_adapters
node_openclaw -.->|"captures and recalls"| node_cloud_api
node_hermes -.->|"captures and recalls"| node_cloud_api
node_mcp -.->|"connects agent clients"| node_cloud_api

click node_python "https://github.com/gajini-prasanth/memori/blob/main/memori/__init__.py"
click node_ts "https://github.com/gajini-prasanth/memori/blob/main/memori-ts/src/memori.ts"
click node_attribution "https://github.com/gajini-prasanth/memori/blob/main/memori/_config.py"
click node_llm_adapters "https://github.com/gajini-prasanth/memori/tree/main/memori/llm/adapters"
click node_capture "https://github.com/gajini-prasanth/memori/blob/main/memori/memory/_manager.py"
click node_augmentation "https://github.com/gajini-prasanth/memori/blob/main/memori/memory/augmentation/_manager.py"
click node_rust_engine "https://github.com/gajini-prasanth/memori/blob/main/core/src/lib.rs"
click node_augment_pipeline "https://github.com/gajini-prasanth/memori/blob/main/core/src/augmentation/pipeline.rs"
click node_worker "https://github.com/gajini-prasanth/memori/blob/main/core/src/runtime/worker.rs"
click node_embedding "https://github.com/gajini-prasanth/memori/blob/main/core/src/embeddings/api.rs"
click node_retrieval "https://github.com/gajini-prasanth/memori/blob/main/core/src/retrieval/pipeline.rs"
click node_search "https://github.com/gajini-prasanth/memori/tree/main/core/src/search"
click node_storage "https://github.com/gajini-prasanth/memori/blob/main/memori/storage/_manager.py"
click node_db_adapters "https://github.com/gajini-prasanth/memori/tree/main/memori/storage/drivers"
click node_cloud_api "https://github.com/gajini-prasanth/memori/blob/main/memori/_network.py"
click node_openclaw "https://github.com/gajini-prasanth/memori/blob/main/integrations/openclaw/src/index.ts"
click node_hermes "https://github.com/gajini-prasanth/memori/blob/main/integrations/hermes/src/memori_hermes/__init__.py"
click node_mcp "https://github.com/gajini-prasanth/memori/blob/main/integrations/claude-code/index.ts"

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_python,node_ts,node_attribution,node_llm_adapters toneBlue
class node_capture,node_augmentation,node_rust_engine,node_augment_pipeline,node_worker,node_embedding toneAmber
class node_retrieval,node_search,node_storage,node_db_adapters,node_cloud_api toneMint
class node_openclaw,node_hermes,node_mcp toneRose
class node_developer,node_llm toneIndigo
```

## Components

### SDKs and API

- [Python SDK](https://github.com/gajini-prasanth/memori/blob/main/memori/__init__.py): `memori/__init__.py`
- [TypeScript SDK](https://github.com/gajini-prasanth/memori/blob/main/memori-ts/src/memori.ts): `memori-ts/src/memori.ts`
- [Attribution and config](https://github.com/gajini-prasanth/memori/blob/main/memori/_config.py): `memori/_config.py`
- [LLM adapters](https://github.com/gajini-prasanth/memori/tree/main/memori/llm/adapters): `memori/llm/adapters`

### Memory processing

- [Conversation capture](https://github.com/gajini-prasanth/memori/blob/main/memori/memory/_manager.py): `memori/memory/_manager.py`
- [Advanced augmentation](https://github.com/gajini-prasanth/memori/blob/main/memori/memory/augmentation/_manager.py): `memori/memory/augmentation/_manager.py`
- [Shared Rust engine](https://github.com/gajini-prasanth/memori/blob/main/core/src/lib.rs): `core/src/lib.rs`
- [Augmentation pipeline](https://github.com/gajini-prasanth/memori/blob/main/core/src/augmentation/pipeline.rs): `core/src/augmentation/pipeline.rs`
- [Background workers](https://github.com/gajini-prasanth/memori/blob/main/core/src/runtime/worker.rs): `core/src/runtime/worker.rs`
- [Embeddings](https://github.com/gajini-prasanth/memori/blob/main/core/src/embeddings/api.rs): `core/src/embeddings/api.rs`

### Retrieval and storage

- [Recall and ranking](https://github.com/gajini-prasanth/memori/blob/main/core/src/retrieval/pipeline.rs): `core/src/retrieval/pipeline.rs`
- [Lexical and similarity search](https://github.com/gajini-prasanth/memori/tree/main/core/src/search): `core/src/search`
- [Storage managers](https://github.com/gajini-prasanth/memori/blob/main/memori/storage/_manager.py): `memori/storage/_manager.py`
- [Database adapters and drivers](https://github.com/gajini-prasanth/memori/tree/main/memori/storage/drivers): `memori/storage/drivers`
- [Memori Cloud API](https://github.com/gajini-prasanth/memori/blob/main/memori/_network.py): `memori/_network.py`

### Agent integrations

- [OpenClaw plugin](https://github.com/gajini-prasanth/memori/blob/main/integrations/openclaw/src/index.ts): `integrations/openclaw/src/index.ts`
- [Hermes provider](https://github.com/gajini-prasanth/memori/blob/main/integrations/hermes/src/memori_hermes/__init__.py): `integrations/hermes/src/memori_hermes/__init__.py`
- [MCP integration](https://github.com/gajini-prasanth/memori/blob/main/integrations/claude-code/index.ts): `integrations/claude-code/index.ts`

### Other components

- **Application developer**
- **LLM provider**

## Connections

- Application developer → Python SDK: configures (evidence: `README.md`)
- Application developer → TypeScript SDK: configures (evidence: `README.md`)
- Python SDK → Attribution and config: sets context (evidence: `memori/__init__.py`)
- Python SDK → Conversation capture: captures interactions (evidence: `memori/__init__.py`)
- TypeScript SDK → Shared Rust engine: delegates memory work
- Conversation capture → Memori Cloud API: posts cloud messages (evidence: `memori/memory/_manager.py`)
- Conversation capture → Advanced augmentation: schedules memory work
- Advanced augmentation → Shared Rust engine: uses shared core
- Shared Rust engine → Augmentation pipeline: runs augmentation (evidence: `core/src/lib.rs`)
- Shared Rust engine → Background workers: starts jobs (evidence: `core/src/lib.rs`)
- Augmentation pipeline → Memori Cloud API: requests augmentation (evidence: `core/src/augmentation/pipeline.rs`)
- Shared Rust engine → Embeddings: creates embeddings
- Shared Rust engine → Recall and ranking: runs recall (evidence: `core/src/lib.rs`)
- Recall and ranking → Lexical and similarity search: ranks candidates (evidence: `core/src/retrieval/pipeline.rs`)
- Recall and ranking → Storage managers: fetches candidates (evidence: `core/src/retrieval/pipeline.rs`)
- Storage managers → Database adapters and drivers: selects drivers (evidence: `memori/storage/_manager.py`)
- Python SDK → Recall and ranking: recalls memories (evidence: `memori/__init__.py`)
- LLM adapters → LLM provider: invokes model
- Python SDK → LLM adapters: integrates providers (evidence: `memori/__init__.py`)
- OpenClaw plugin → Memori Cloud API: captures and recalls (evidence: `README.md`)
- Hermes provider → Memori Cloud API: captures and recalls (evidence: `README.md`)
- MCP integration → Memori Cloud API: connects agent clients (evidence: `README.md`)
