MCPcopy Index your code
hub / github.com/KShivendu/smoldb

github.com/KShivendu/smoldb @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
421 symbols 980 edges 63 files 86 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

smoldb

A smol distributed database implemented from scratch. It is heavily inspired by Qdrant's design.

Usage:

# Run with Docker
docker pull smoldot/smoldb

# Or compile locally:
cargo run -r
# Create collection
curl -X PUT http://localhost:9900/collections/test \
  -H "Content-Type: application/json" \
  -d '{
    "params": "..."
  }'

# Add points
curl -X PUT http://localhost:9900/collections/test/points \
  -H "Content-Type: application/json" \
  -d '{
    "points": [ { "id": 0, "payload": { "msg": "hello world" } } ]
  }'

# Get point (response below)
curl -X GET http://localhost:9900/collections/test/points/0

# Response:
{
  "id": 0,
  "payload": {
    "msg": "hello world"
  }
}

# Get collection's cluster info (response below)
curl -X GET http://localhost:9900/collections/test/cluster

# Response:
{
    "peer_id": 0,
    "shard_count": 2,
    "local_shards": [
        {
            "shard_id": 1,
            "point_count": 0,
            "state": "Active"
        },
        {
            "shard_id": 0,
            "point_count": 1,
            "state": "Active"
        }
    ],
    "remote_shards": []
}

Check roadmap for details

Extension points exported contracts — how you extend this code

FieldIndexTrait (Interface)
(no doc) [3 implementers]
src/storage/segment/index/payload_index.rs
Raft (Interface)
(no doc) [1 implementers]
src/api/grpc/schema.rs
ShardOperationTrait (Interface)
(no doc) [2 implementers]
src/storage/replicas/mod.rs
PointsInternal (Interface)
(no doc) [1 implementers]
src/api/grpc/schema.rs
HasPointId (Interface)
(no doc) [2 implementers]
src/storage/replicas/mod.rs
Smol (Interface)
(no doc)
src/api/grpc/schema.rs

Core symbols most depended-on inside this repo

clone
called by 122
src/api/grpc/schema.rs
iter
called by 65
src/storage/segment/index/vector/mod.rs
get
called by 41
src/storage/segment/index/text/posting.rs
insert
called by 39
src/storage/segment/index/integer.rs
send
called by 16
src/api/grpc/schema.rs
create_tempdir
called by 13
benches/collection/common.rs
create_channel_service
called by 12
benches/collection/common.rs
generate_points
called by 10
benches/collection/common.rs

Shape

Method 197
Function 111
Class 92
Enum 15
Interface 6

Languages

Rust100%

Modules by API surface

src/api/grpc/schema.rs52 symbols
src/storage/segment/index/payload_index.rs21 symbols
tools/raft-playground/src/main.rs19 symbols
src/storage/replicas/mod.rs17 symbols
src/storage/collection.rs17 symbols
benches/collection/common.rs17 symbols
src/consensus/mod.rs15 symbols
src/storage/segment/index/text/bm25.rs14 symbols
src/consensus/raft_storage.rs13 symbols
tools/smolbench/src/apis.rs12 symbols
src/storage/segment/mod.rs12 symbols
src/storage/segment/index/vector/mod.rs11 symbols

For agents

$ claude mcp add smoldb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact