Skip to main content
Vector databases store document embeddings and enable fast similarity search. Definable includes seven implementations in the definable.vectordb module and a base class for custom backends.
All vector DB classes are imported from definable.vectordb, not definable.knowledge. The definable.knowledge module re-exports InMemoryVectorDB for backward compatibility but will show a deprecation warning.

InMemoryVectorDB

Stores everything in memory. Great for development, testing, and small datasets.
Characteristics:
  • No external dependencies (requires numpy)
  • Uses cosine similarity for search
  • Data is lost when the process exits

PgVector

Uses PostgreSQL with the pgvector extension. Suitable for production workloads with persistent storage and scalable search.
Requires psycopg[binary] and pgvector. Install with:
Your PostgreSQL instance must have the pgvector extension enabled:

Qdrant

High-performance vector search engine.

ChromaDb

MongoDb

MongoDB Atlas vector search.

RedisDB

Redis with RediSearch for vector similarity.

PineconeDb

Pinecone managed vector database.

Using with Knowledge

Pass any vector DB instance to Knowledge:

VectorDB Interface

All implementations share the same base interface from definable.vectordb.VectorDB:

Creating a Custom VectorDB

Subclass VectorDB from definable.vectordb to integrate any vector store. The key abstract methods to implement are:

Choosing a Vector Database