Vector Store Backends Supported by semantica.vector_store: FAISS, Qdrant, Weaviate, Pinecone & pgvector
The semantica.vector_store module supports eight distinct backends—FAISS, Qdrant, Weaviate, Pinecone, pgvector, Milvus, in-memory, and SQLite—each accessible through a unified VectorStore interface that validates against the SUPPORTED_BACKENDS constant.
The semantica-agi/semantica repository provides a pluggable vector storage layer via the semantica.vector_store package. Whether you require a local embedding index for development or a managed cloud service for production, the library dynamically instantiates the correct concrete implementation based on the backend name you provide.
Complete List of Supported Backends
The canonical allowlist of backends is defined in semantica/vector_store/vector_store.py at lines 12-13:
SUPPORTED_BACKENDS = {
"faiss", "weaviate", "qdrant", "milvus",
"pinecone", "pgvector", "inmemory", "sqlite"
}
When you call VectorStore(backend="..."), the constructor validates your string against this set. If valid, the internal _init_backend_store method instantiates the corresponding concrete store class (e.g., FAISSStore, QdrantStore). Each implementation resides in its own module and exposes a common API for vector operations.
FAISS (Local Vector Index)
- Module:
semantica/vector_store/faiss_store.py - Class:
FAISSStore - Characteristics: Local, pure-Python vector index supporting flat, IVF, HNSW, and PQ index types. Requires no external services.
Qdrant (Remote Vector Database)
- Module:
semantica/vector_store/qdrant_store.py - Class:
QdrantStore - Characteristics: Remote vector database with collection-based organization, payload filtering, and REST/gRPC interfaces.
Weaviate (Graph-Aware Search)
- Module:
semantica/vector_store/weaviate_store.py - Class:
WeaviateStore - Characteristics: Cloud or on-premise deployment with graph-aware capabilities and hybrid search (vector + BM25).
Pinecone (Managed SaaS)
- Module:
semantica/vector_store/pinecone_store.py - Class:
PineconeStore - Characteristics: Fully managed SaaS vector database offering namespace isolation, metadata filtering, and auto-scaling.
pgvector (PostgreSQL Extension)
- Module:
semantica/vector_store/pgvector_store.py - Class:
PgVectorStore - Characteristics: Leverages the PostgreSQL pgvector extension for ACID-compliant vector storage with SQL-based filtering and indexing.
Additional Backends
Beyond the five primary backends asked about, semantica.vector_store also supports:
- Milvus:
semantica/vector_store/milvus_store.py(MilvusStore) — Distributed vector database with GPU acceleration capabilities. - In-memory:
semantica/vector_store/vector_store.py— Lightweight Python dictionary implementation for rapid prototyping and testing. - SQLite:
semantica/vector_store/sqlite_vec_store.py(SQLiteVectorStore) — Persistent local storage using SQLite with vector extensions.
How to Instantiate Each Backend
The following examples demonstrate minimal configuration for the five queried backends. All examples assume you have installed the specific third-party client libraries (e.g., faiss-cpu, qdrant-client, weaviate-client, pinecone-client, psycopg2).
FAISS (Local, No External Service)
from semantica.vector_store import VectorStore
faiss_store = VectorStore(backend="faiss", config={"dimension": 384})
faiss_store.store_vectors([[0.1, 0.2, 0.3]], [{"title": "doc1"}])
print(faiss_store.search_vectors([0.1, 0.2, 0.3], k=5))
Qdrant (Remote Service)
from semantica.vector_store import VectorStore
qdrant_store = VectorStore(
backend="qdrant",
config={"url": "http://localhost:6333", "collection_name": "my-collection", "dimension": 384}
)
qdrant_store.store_vectors([[0.1, 0.2, 0.3]], [{"title": "doc1"}])
print(qdrant_store.search_vectors([0.1, 0.2, 0.3], k=5))
Weaviate (Cloud or On-Premise)
from semantica.vector_store import VectorStore
weaviate_store = VectorStore(
backend="weaviate",
config={"url": "http://localhost:8080", "class_name": "Document", "dimension": 384}
)
weaviate_store.store_vectors([[0.1, 0.2, 0.3]], [{"title": "doc1"}])
print(weaviate_store.search_vectors([0.1, 0.2, 0.3], k=5))
Pinecone (Managed SaaS)
from semantica.vector_store import VectorStore
pinecone_store = VectorStore(
backend="pinecone",
config={"api_key": "YOUR_API_KEY", "environment": "us-west1-gcp", "index_name": "my-index", "dimension": 384}
)
pinecone_store.store_vectors([[0.1, 0.2, 0.3]], [{"title": "doc1"}])
print(pinecone_store.search_vectors([0.1, 0.2, 0.3], k=5))
pgvector (PostgreSQL Extension)
from semantica.vector_store import VectorStore
pgvector_store = VectorStore(
backend="pgvector",
config={
"connection_string": "postgresql://user:pass@localhost/db",
"table_name": "vectors",
"dimension": 384,
"distance_metric": "cosine"
}
)
pgvector_store.store_vectors([[0.1, 0.2, 0.3]], [{"title": "doc1"}])
print(pgvector_store.search_vectors([0.1, 0.2, 0.3], k=5))
Architecture and Extensibility
Each concrete store implements a common interface exposing methods such as add_vectors, search_vectors, and delete_vectors. The high-level VectorStore class acts as a factory: it delegates all operations to the instantiated backend while providing a consistent Python API regardless of the underlying database.
To extend support for a new backend:
- Create a new module in
semantica/vector_store/(e.g.,new_store.py). - Implement the required methods:
add_vectors,search_vectors,delete_vectors, etc. - Add the backend identifier string to the
SUPPORTED_BACKENDSset insemantica/vector_store/vector_store.py. - Update the
_init_backend_storemethod to import and instantiate your new class when the backend name is requested.
Summary
- The
semantica.vector_storemodule supports eight backends: FAISS, Qdrant, Weaviate, Pinecone, pgvector, Milvus, in-memory, and SQLite. - Backend validation occurs against the
SUPPORTED_BACKENDSconstant defined insemantica/vector_store/vector_store.py. - Each backend resides in a dedicated module (e.g.,
faiss_store.py,qdrant_store.py) containing a specific implementation class (e.g.,FAISSStore,QdrantStore). - All backends expose unified methods for vector storage and retrieval, including
store_vectorsandsearch_vectors. - Instantiation requires passing the backend name as a string and a configuration dictionary to the
VectorStoreconstructor.
Frequently Asked Questions
Which vector store backend should I use for local development?
Use FAISS or the in-memory backend. FAISS provides high-performance local vector indexing without external dependencies, while the in-memory backend uses simple Python dictionaries for rapid prototyping. Both are defined in SUPPORTED_BACKENDS and require no network configuration.
How do I check if a specific backend is available in my semantica installation?
Inspect the SUPPORTED_BACKENDS constant in semantica/vector_store/vector_store.py. If the backend string exists in that set, the library supports it natively. You must also install the corresponding client library (e.g., pip install faiss-cpu or pip install qdrant-client) for the backend to function at runtime.
Can I switch between vector backends without modifying my application logic?
Yes. The VectorStore class abstracts backend-specific details, so you can change the backend parameter and configuration dictionary without altering calls to store_vectors() or search_vectors(). The _init_backend_store method handles instantiation of the correct concrete class internally.
Does semantica.vector_store support Milvus and SQLite in addition to the main five?
Yes. The SUPPORTED_BACKENDS set includes "milvus" for distributed GPU-accelerated vector search (module: milvus_store.py) and "sqlite" for persistent local storage using SQLite vector extensions (module: sqlite_vec_store.py). Both follow the same instantiation pattern as FAISS and Qdrant.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →