Skip to main content

A blazing-fast, lightweight in-memory vector database built in pure Python.

Project description

PadmaDB 🪷

A blazing-fast, lightweight in-memory vector database built in pure Python and NumPy. Pinecone, Milvus, and Weaviate are incredible for enterprise-scale billions of vectors. But when you are building local AI apps, testing RAG pipelines, or running lightweight microservices, spinning up a massive cloud infrastructure is overkill. PadmaDB solves this by providing a hyper-fast, zero-dependency (beyond NumPy/FastAPI) vector search engine that runs locally and persists to disk.

🚀 Features

Pure Python/NumPy Engine: No C++ compilers, Docker containers, or cloud APIs required.

Exact Nearest Neighbor (k-NN): Guarantees 100% recall using optimized float32 Cosine Similarity matrix multiplications.

RESTful Architecture: Ships with a built-in FastAPI server, allowing it to act as an independent microservice database.

Local Persistence: Automatically serializes vector state to your local disk.

📦 Installation

pip install padmadb

⚡ Quickstart

  1. Start the Database Server You can launch the server in one line of code:
from padmadb.server import run_server

if __name__ == "__main__":
    # Runs the database engine on [http://0.0.0.0:8000](http://0.0.0.0:8000)
    run_server()
  1. Connect and Query (Client SDK) In a separate Python script or Jupyter Notebook:
from padmadb import PadmaClient

client = PadmaClient(host="http://localhost:8000")

1. Insert a 384-dimensional vector (e.g., from all-MiniLM-L6-v2)

vector_data = [0.12, -0.45, 0.88, ...] # Must be length 384
client.insert(
    vec_id="doc_1", 
    vector=vector_data, 
    metadata={"text": "Machine learning is fascinating."}
)

2. Search for the Top-K nearest neighbors

results = client.search(vector=vector_data, top_k=1)
print(results)

🧠 Architecture & Roadmap

PadmaDB v0.1.0 utilizes a brute-force exact search mechanism tailored for datasets up to 100,000 vectors where in-memory matrix multiplication is effectively instantaneous.

Upcoming in v0.2.x:

Implementation of threading.Lock() for concurrent write-safety. Transition from JSON persistence to memory-mapped .npy binary arrays for faster cold boots. HNSW (Hierarchical Navigable Small World) indexing for billion-scale querying.

🤝 Contributing

PadmaDB is fully open-source. We warmly welcome collaborators, researchers, and cloners!

Clone the repo, fork it, break it, fix it, and submit a PR! Let's build the ultimate local AI database together.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

padmadb-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

padmadb-0.1.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file padmadb-0.1.2.tar.gz.

File metadata

  • Download URL: padmadb-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for padmadb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1f73adab6ea38406992b86d31058bee609a0d696fa3c1f556db136004cd8fb29
MD5 98a30ec441896396268d5cf5e545163b
BLAKE2b-256 5b3571c1ceef893ff031bcae2b3259737700efabd5f4e9478f010d290b0887aa

See more details on using hashes here.

File details

Details for the file padmadb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: padmadb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for padmadb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be2d6edfc84c443630605b1740d5790a1f4dc7c2027035d5f8e30e7a07ccf19e
MD5 0a5c8cb55585420f65faef4bebb0dbf7
BLAKE2b-256 617328a15fa6943b95a77d1f64a8d6adae4a597691666336d04f908a62903e48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page