Skip to main content

ZeroDB vector store for LangChain - AI-native vector database with free embeddings, semantic search, and RAG support. Pinecone alternative.

Project description

langchain-zerodb

ZeroDB vector store integration for LangChain - the AI-native vector database with free embeddings and sub-millisecond semantic search.

Why ZeroDB?

  • Free embeddings - BAAI/bge-small-en-v1.5 (384-dim) powered by TEI, no OpenAI costs
  • Sub-millisecond search - pgvector with HNSW indexes
  • Zero infrastructure - fully managed, no servers to run
  • Instant provisioning - POST /api/v1/instant-db gets you a database in one request
  • Built for agents - MCP server, memory API, event streams

Installation

pip install langchain-zerodb

Quick Start

from langchain_zerodb import ZeroDBVectorStore

# Initialize (get your API key at ainative.studio)
vectorstore = ZeroDBVectorStore(
    api_key="your-api-key",
    project_id="your-project-id",
)

# Add documents
ids = vectorstore.add_texts(
    ["ZeroDB is fast", "Semantic search is powerful"],
    metadatas=[{"source": "docs"}, {"source": "blog"}],
)

# Similarity search
results = vectorstore.similarity_search("fast database", k=5)
for doc in results:
    print(doc.page_content, doc.metadata)

# Search with scores
scored = vectorstore.similarity_search_with_score("fast database", k=5)
for doc, score in scored:
    print(f"{score:.3f}: {doc.page_content}")

Use with LangChain Chains

from langchain_zerodb import ZeroDBVectorStore
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough

vectorstore = ZeroDBVectorStore(
    api_key="your-api-key",
    project_id="your-project-id",
)
retriever = vectorstore.as_retriever(search_kwargs={"k": 5})

# RAG chain
template = "Answer based on context:\n{context}\n\nQuestion: {question}"
prompt = ChatPromptTemplate.from_template(template)

chain = (
    {"context": retriever, "question": RunnablePassthrough()}
    | prompt
)

Get a Free API Key

  1. Sign up at ainative.studio
  2. Create a ZeroDB project
  3. Copy your API key

Or get an instant database with no signup:

curl -X POST https://api.ainative.studio/api/v1/public/instant-db

Links

License

MIT - Built by AINative Studio

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

langchain_zerodb-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

langchain_zerodb-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_zerodb-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_zerodb-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for langchain_zerodb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47158154d04a6ab1d6f52b62537d4f42438af0a5f6aae9fc35ef799dceec5f41
MD5 b850704d1c7843a20e5b09c901d6fd84
BLAKE2b-256 6c809d7330f25303fa04758ac7f1085694b4d2713efdb167b6ab7673cd18e701

See more details on using hashes here.

File details

Details for the file langchain_zerodb-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_zerodb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f4c8580dcc9404d189d0d73b10f7c64113f525ebf7443f9bdabbfa0c50be400
MD5 bdcdf3f5f8f22250241185581ac49113
BLAKE2b-256 6a95de57fa076cf2a5526bae8eaed1cc5181306449106be4cf6ebe137df391d2

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