# omaru12345/nano-rag architecture

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

- Interactive diagram: https://gitdiagram.com/omaru12345/nano-rag
- Repository: https://github.com/omaru12345/nano-rag

## Overview

nano-rag is a planned, local-first RAG SDK for indexing on-device documents and supplying context to on-device LLMs. The README describes an Android wrapper around a Rust core, with ONNX embeddings and HNSW search; it says implementation has not started. The supplied tree contains no runtime source, so component paths are null and relationships reflect documented plans, not inspected calls.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDK interface"]
  node_android["Android wrapper"]
end

subgraph group_core["Retrieval core"]
  node_rust["Rust core"]
  node_embedding["ONNX embeddings"]
  node_hnsw["HNSW search"]
  node_storage[("Local index")]
end

subgraph group_runtime["On-device runtime"]
  node_llm["On-device LLM"]
end

node_app(("Mobile app"))
node_documents["Local documents"]

node_app -->|"integrates"| node_android
node_android -->|"wraps"| node_rust
node_documents -->|"indexes locally"| node_rust
node_rust -->|"computes"| node_embedding
node_rust -->|"searches with"| node_hnsw
node_rust -->|"stores index"| node_storage
node_rust -->|"supplies context"| node_llm

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_android toneBlue
class node_rust,node_embedding,node_hnsw,node_storage toneAmber
class node_llm toneMint
class node_app,node_documents toneIndigo
```

## Components

### SDK interface

- **Android wrapper**

### Retrieval core

- **Rust core**
- **ONNX embeddings**
- **HNSW search**
- **Local index**

### On-device runtime

- **On-device LLM**

### Other components

- **Mobile app**
- **Local documents**

## Connections

- Mobile app → Android wrapper: integrates (evidence: `README.md`)
- Android wrapper → Rust core: wraps (evidence: `README.md`)
- Local documents → Rust core: indexes locally (evidence: `README.md`)
- Rust core → ONNX embeddings: computes (evidence: `README.md`)
- Rust core → HNSW search: searches with (evidence: `README.md`)
- Rust core → Local index: stores index (evidence: `README.md`)
- Rust core → On-device LLM: supplies context (evidence: `README.md`)
