TL;DR â NexusâMind is a teaching vector database: tiny, readable, and eager for contributions that push it from âtoyâ to âtoolâ.
A tiny, hackâfriendly vector store that piggyâbacks on an educational Go Raft implementation. Perfect for experiments, not production (yet!).
NexusâMind started as a playground for learning:
- Consensus â borrow the Raft labs code from MITÂ 6.824 for strong consistency.
- Vector search internals â write the simplest possible index first (
LinearIndex
), then iterate. - Controlâplane exploration â prototype how Raft (strong, synchronous) and Gossip (weak, asynchronous) can coexist without stepping on each other.
If you just need a battleâtested store, use Milvus, Qdrant or Weaviate.
If you want to tweak every line and watch a DB grow, read on.
Area | Status | Notes |
---|---|---|
Vector CRUD & KâNN | â Â Works (linear scan) | See src/vector/index/linear.go |
HTTP API | â
 Basic /collections/:name/query |
JSON; no auth |
Inâmemory persistence | â | Vectors lost on restart |
Raft log replication | đ Â Library is there, not wired into vector store | From MITÂ 6.824 labs |
Shard & KV layers | đ  Present but demoâonly | src/shard* |
Gossip membership | đ§Â Planned | Design in docs/ARCHITECTURE.md |
Advanced indexes (HNSW/IVF/PQ) | đ§ | Roadâmapped |
Docker compose cluster | đ§ | ./run.sh is a placeholder |
# Prereqs: Go 1.21+
git clone https://github.com/EdwardTang/Nexus-Mind.git
cd Nexus-Mind/src
go run ./main.go
Open another terminal and try:
# Add a vector
curl -X POST localhost:8080/vectors \
-H "Content-Type: application/json" \
-d '{"id":"vec1","vector":[0.1,0.2,0.3]}'
# Similarity search (topâ5)
curl -X POST localhost:8080/search \
-H "Content-Type: application/json" \
-d '{"vector":[0.1,0.2,0.3],"k":5}'
Client ââHTTP/JSONâââ¶ Query Router
â
âŒ
+--------------+
| Collection |
| (inâmem) |
+--------------+
â
+-----------+
| Index | â Linear scan today
+-----------+
Future: multiple collections share a tokenâring sharding layer; each shard is a Raft group for strong writes. Gossip/Â SWIM spreads node liveness and ring changes.
Detailed design docs live in /docs
:
ARCHITECTURE.md
â 3âlayer blueprint (coordination, storage, query).vector_store_layer.md
â ideas for HNSW & disk persistence.ROADMAP.md
â milestone tracker.
src/
âââ raft/ â Standâalone Raft library (leader election, log, snapshot)
âââ vector/
â âââ index/ â LinearIndex (baseline)
â âââ query/ â HTTP layer & filter DSL
â âââ distance.go â SIMDâbacked metrics
âââ shard* â Experiments with sharded KV on top of Raft
âââ main.go â Demo server wiring everything together
docs/ ⊠â design & progress notes
- Wire Raft into vector mutations â WAL + replicas.
- Replace linear scan with HNSW â keep bruteâforce as fallâback.
- Cluster bootstrap & gossip membership â SWIMâlike heartbeat.
- Onâdisk segments â mmap + background compaction.
- Observability â Prometheus metrics & Jaeger traces.
See docs/ROADMAP.md
for the full list.
PRs and design sketches are welcome! Start with a good first issue:
vector/index
: plug in any ANN algorithm you fancy.raft
: add snapshotting tests.- Docs proofreading.
Please run go test ./...
before opening a PR.
Apache 2.0 â see LICENSE
.