# ajays0708/endee architecture

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

- Interactive diagram: https://gitdiagram.com/ajays0708/endee
- Repository: https://github.com/ajays0708/endee

## Overview

Endee is a vector database server. Clients send index-management, vector-ingestion, and search requests to the HTTP server; the index manager coordinates dense HNSW and optional sparse retrieval, with results returned through the server. The implementation also includes quantization, filtering, persistent vector and sparse stores, ID mapping, and write-ahead logging. README capabilities establish the API and authentication modes; some internal links are dashed because the relevant call sites were not included in the excerpts.

Main entry points: [`src/core/ndd.hpp`](https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp) (Index manager), [`src/main.cpp`](https://github.com/ajays0708/endee/blob/master/src/main.cpp) (HTTP API), [`src/sparse/bmw.hpp`](https://github.com/ajays0708/endee/blob/master/src/sparse/bmw.hpp) (Sparse retrieval), [`src/storage/vector_storage.hpp`](https://github.com/ajays0708/endee/blob/master/src/storage/vector_storage.hpp) (Vector store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_server["HTTP API<br/>[main.cpp]"]
  node_auth["Token auth<br/>[auth.hpp]"]
end

subgraph group_indexing["Index and search"]
  node_manager["Index manager<br/>[ndd.hpp]"]
  node_dense["Dense vectors<br/>[ndd.hpp]"]
  node_hybrid["Hybrid search<br/>[ndd.hpp]"]
  node_filter["Metadata filters<br/>[filter.hpp]"]
end

subgraph group_persistence["Persistence"]
  node_vectors[("Vector store<br/>[vector_storage.hpp]")]
  node_sparse_store[("Sparse store<br/>[sparse_storage.hpp]")]
  node_ids[("ID mapping<br/>[id_mapper.hpp]")]
  node_metadata[("Index metadata<br/>[index_meta.hpp]")]
  node_wal[("Write-ahead log<br/>[wal.hpp]")]
end

subgraph group_engine["Search engine"]
  node_hnsw["HNSW index<br/>[hnswalg.h]"]
  node_quant["Quantization<br/>[dispatch.hpp]"]
  node_sparse["Sparse retrieval<br/>[bmw.hpp]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_server -->|"routes operations"| node_manager
node_server -.->|"checks tokens"| node_auth
node_manager -->|"creates index"| node_hnsw
node_manager -->|"fetches vectors"| node_vectors
node_manager -->|"initializes storage"| node_sparse_store
node_manager -.->|"runs retrieval"| node_sparse
node_hybrid -->|"combines results"| node_sparse
node_dense -.->|"searches index"| node_hnsw
node_dense -.->|"encodes vectors"| node_quant
node_hybrid -.->|"runs dense search"| node_dense
node_manager -.->|"maps identifiers"| node_ids
node_manager -.->|"loads metadata"| node_metadata
node_manager -->|"logs updates"| node_wal
node_vectors -->|"adds filters"| node_filter
node_sparse_store -->|"uses index"| node_sparse
node_server -.->|"returns results"| node_client

click node_server "https://github.com/ajays0708/endee/blob/master/src/main.cpp"
click node_auth "https://github.com/ajays0708/endee/blob/master/src/server/auth.hpp"
click node_manager "https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp"
click node_dense "https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp"
click node_hybrid "https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp"
click node_filter "https://github.com/ajays0708/endee/blob/master/src/filter/filter.hpp"
click node_hnsw "https://github.com/ajays0708/endee/blob/master/src/hnsw/hnswalg.h"
click node_quant "https://github.com/ajays0708/endee/blob/master/src/quant/dispatch.hpp"
click node_sparse "https://github.com/ajays0708/endee/blob/master/src/sparse/bmw.hpp"
click node_vectors "https://github.com/ajays0708/endee/blob/master/src/storage/vector_storage.hpp"
click node_sparse_store "https://github.com/ajays0708/endee/blob/master/src/sparse/sparse_storage.hpp"
click node_ids "https://github.com/ajays0708/endee/blob/master/src/storage/id_mapper.hpp"
click node_metadata "https://github.com/ajays0708/endee/blob/master/src/storage/index_meta.hpp"
click node_wal "https://github.com/ajays0708/endee/blob/master/src/storage/wal.hpp"

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_server,node_auth,node_client toneBlue
class node_manager,node_dense,node_hybrid,node_filter toneAmber
class node_vectors,node_sparse_store,node_ids,node_metadata,node_wal toneMint
class node_hnsw,node_quant,node_sparse toneRose
```

## Components

### API and access

- [HTTP API](https://github.com/ajays0708/endee/blob/master/src/main.cpp): `src/main.cpp`
- [Token auth](https://github.com/ajays0708/endee/blob/master/src/server/auth.hpp): `src/server/auth.hpp`

### Index and search

- [Index manager](https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp): `src/core/ndd.hpp`
- [Dense vectors](https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp): `src/core/ndd.hpp`
- [Hybrid search](https://github.com/ajays0708/endee/blob/master/src/core/ndd.hpp): `src/core/ndd.hpp`
- [Metadata filters](https://github.com/ajays0708/endee/blob/master/src/filter/filter.hpp): `src/filter/filter.hpp`

### Persistence

- [Vector store](https://github.com/ajays0708/endee/blob/master/src/storage/vector_storage.hpp): `src/storage/vector_storage.hpp`
- [Sparse store](https://github.com/ajays0708/endee/blob/master/src/sparse/sparse_storage.hpp): `src/sparse/sparse_storage.hpp`
- [ID mapping](https://github.com/ajays0708/endee/blob/master/src/storage/id_mapper.hpp): `src/storage/id_mapper.hpp`
- [Index metadata](https://github.com/ajays0708/endee/blob/master/src/storage/index_meta.hpp): `src/storage/index_meta.hpp`
- [Write-ahead log](https://github.com/ajays0708/endee/blob/master/src/storage/wal.hpp): `src/storage/wal.hpp`

### Search engine

- [HNSW index](https://github.com/ajays0708/endee/blob/master/src/hnsw/hnswalg.h): `src/hnsw/hnswalg.h`
- [Quantization](https://github.com/ajays0708/endee/blob/master/src/quant/dispatch.hpp): `src/quant/dispatch.hpp`
- [Sparse retrieval](https://github.com/ajays0708/endee/blob/master/src/sparse/bmw.hpp): `src/sparse/bmw.hpp`

### Other components

- **API client**

## Connections

- API client → HTTP API: sends requests (evidence: `README.md`)
- HTTP API → Index manager: routes operations (evidence: `src/main.cpp`)
- HTTP API → Token auth: checks tokens (evidence: `src/main.cpp`)
- Index manager → HNSW index: creates index (evidence: `src/core/ndd.hpp`)
- Index manager → Vector store: fetches vectors (evidence: `src/core/ndd.hpp`)
- Index manager → Sparse store: initializes storage (evidence: `src/core/ndd.hpp`)
- Index manager → Sparse retrieval: runs retrieval
- Hybrid search → Sparse retrieval: combines results (evidence: `src/core/ndd.hpp`)
- Dense vectors → HNSW index: searches index
- Dense vectors → Quantization: encodes vectors (evidence: `src/core/ndd.hpp`)
- Hybrid search → Dense vectors: runs dense search (evidence: `src/core/ndd.hpp`)
- Index manager → ID mapping: maps identifiers (evidence: `src/core/ndd.hpp`)
- Index manager → Index metadata: loads metadata (evidence: `src/core/ndd.hpp`)
- Index manager → Write-ahead log: logs updates (evidence: `src/core/ndd.hpp`)
- Vector store → Metadata filters: adds filters (evidence: `src/storage/vector_storage.hpp`)
- Sparse store → Sparse retrieval: uses index (evidence: `src/sparse/sparse_storage.hpp`)
- HTTP API → API client: returns results (evidence: `README.md`)
