Skip to main content

Quickstart

The fastest way to get started.

git clone https://github.com/lachu97/vector-db
cd vector-db
docker compose up --build

The server starts on http://localhost:8000. The default API key is test-key.

note

Change API_KEY in docker-compose.yml before deploying to production.

Option 2: Python (local)

git clone https://github.com/lachu97/vector-db
cd vector-db
pip install -r requirements.txt
uvicorn main:app --reload

Your First Vectors

1. Create a collection

A collection holds vectors of a fixed dimension with a chosen distance metric.

curl -X POST http://localhost:8000/v1/collections \
-H "x-api-key: test-key" \
-H "Content-Type: application/json" \
-d '{"name": "docs", "dim": 3, "distance_metric": "cosine"}'

2. Upsert vectors

Insert vectors with optional metadata.

curl -X POST http://localhost:8000/v1/collections/docs/upsert \
-H "x-api-key: test-key" \
-H "Content-Type: application/json" \
-d '{
"external_id": "doc-1",
"vector": [0.1, 0.8, 0.3],
"metadata": {"title": "Getting Started", "category": "tutorial"}
}'

Find the most similar vectors to a query.

curl -X POST http://localhost:8000/v1/collections/docs/search \
-H "x-api-key: test-key" \
-H "Content-Type: application/json" \
-d '{"vector": [0.1, 0.8, 0.2], "k": 5}'

Explore Further

  • Collections — Learn about namespacing, dimensions, and distance metrics
  • Hybrid Search — Combine vector and keyword search with RRF
  • Python SDK — Full Python SDK reference with examples
  • Configuration — All environment variables and settings