Vector databases
Register the built-in vector adapters once, change the selected backend with environment variables, or keep familiar LangChain and LlamaIndex vector-store imports while routing retrieval through Agent RT. The built-in service integrations remain dependency-light and do not require vendor SDKs.
Supported backends
Agent RT includes dependency-light HTTP adapters for Chroma, Milvus, Pinecone, Qdrant, and Weaviate. FAISS and pgvector remain registry extensions because their normal integration paths require native/local or database drivers.
| Backend | AGENT_RT_VECTOR_DB | Credential variable | Notes |
|---|---|---|---|
| Chroma | chroma | CHROMA_API_KEY | Optional tenant/database options. |
| Milvus | milvus | MILVUS_TOKEN | Uses the Milvus REST vector search endpoint. |
| Pinecone | pinecone | PINECONE_API_KEY | Optional namespace via an option variable. |
| Qdrant | qdrant | QDRANT_API_KEY | Uses collection point search. |
| Weaviate | weaviate | WEAVIATE_API_KEY | Field names can be overridden with options. |
Configure once
The common environment variables are the same for every backend:
export AGENT_RT_VECTOR_DB="qdrant"
export AGENT_RT_VECTOR_DB_URL="https://your-vector-db.example"
export AGENT_RT_VECTOR_DB_COLLECTION="docs"
# Optional generic credential and timeout.
export AGENT_RT_VECTOR_DB_API_KEY="..."
export AGENT_RT_VECTOR_DB_TIMEOUT_SECONDS="20"
You may use the backend-native credential variable instead of AGENT_RT_VECTOR_DB_API_KEY. Backend-specific settings use the AGENT_RT_VECTOR_DB_OPTION_* prefix.
Switch backends without changing code
The application registers the popular backends once. Selection happens later from the environment.
# Qdrant
export AGENT_RT_VECTOR_DB="qdrant"
export AGENT_RT_VECTOR_DB_URL="https://qdrant.example"
export AGENT_RT_VECTOR_DB_COLLECTION="docs"
export QDRANT_API_KEY="..."
# Switch the same code to Pinecone
export AGENT_RT_VECTOR_DB="pinecone"
export AGENT_RT_VECTOR_DB_URL="https://your-index.svc.pinecone.io"
export AGENT_RT_VECTOR_DB_COLLECTION="docs"
export PINECONE_API_KEY="..."
export AGENT_RT_VECTOR_DB_OPTION_NAMESPACE="production"
RetrievalProvider interface.Python
from agent_rt import (
RetrievalQuery,
VectorDBProviderRegistry,
load_model,
register_popular_vector_db_backends,
vector_db_provider_from_environment,
)
embedding_provider = load_model()
registry = VectorDBProviderRegistry()
register_popular_vector_db_backends(
registry,
embedding_provider=embedding_provider,
)
provider = vector_db_provider_from_environment(registry)
results = await provider.search(
RetrievalQuery("How does Agent RT handle tools?", limit=5)
)
TypeScript
const {
VectorDBProviderRegistry,
loadModel,
registerPopularVectorDBBackends,
vectorDBProviderFromEnvironment,
} = require("agent-rt");
const embeddingProvider = await loadModel();
const registry = new VectorDBProviderRegistry();
registerPopularVectorDBBackends(registry, { embeddingProvider });
const provider = vectorDBProviderFromEnvironment(registry);
const results = await provider.search({
text: "How does Agent RT handle tools?",
limit: 5,
});
LangChain vector-store compatibility
Existing LangChain retrieval code can keep the vendor-shaped class names while moving the import to Agent RT. The adapter fixes the backend implied by the import and sends similarity search through Agent RT's vector DB provider.
| Upstream Python | Agent RT Python |
|---|---|
langchain_chroma.Chroma | agent_rt.langchain_chroma.Chroma |
langchain_pinecone.PineconeVectorStore | agent_rt.langchain_pinecone.PineconeVectorStore |
langchain_qdrant.QdrantVectorStore | agent_rt.langchain_qdrant.QdrantVectorStore |
langchain_milvus.Milvus | agent_rt.langchain_milvus.Milvus |
langchain_weaviate.WeaviateVectorStore | agent_rt.langchain_weaviate.WeaviateVectorStore |
from agent_rt.langchain_qdrant import QdrantVectorStore
store = QdrantVectorStore(
embedding=embeddings,
)
documents = await store.asimilarity_search(
"How does Agent RT retrieve context?",
k=4,
)
TypeScript/JavaScript exports the same compatibility layer through agent-rt/@langchain/chroma, agent-rt/@langchain/pinecone, agent-rt/@langchain/qdrant, agent-rt/@langchain/milvus, and agent-rt/@langchain/weaviate. Community-style subpaths such as agent-rt/@langchain/community/vectorstores/qdrant are also published.
import { QdrantVectorStore } from "agent-rt/@langchain/qdrant";
const store = new QdrantVectorStore(embeddings);
const documents = await store.similaritySearch(
"How does Agent RT retrieve context?",
4,
);
LlamaIndex vector-store compatibility
LlamaIndex migrations preserve the upstream vector_stores module hierarchy in Python and expose equivalent package aliases in TypeScript.
| Upstream Python | Agent RT Python |
|---|---|
llama_index.vector_stores.chroma.ChromaVectorStore | agent_rt.llama_index.vector_stores.chroma.ChromaVectorStore |
llama_index.vector_stores.pinecone.PineconeVectorStore | agent_rt.llama_index.vector_stores.pinecone.PineconeVectorStore |
llama_index.vector_stores.qdrant.QdrantVectorStore | agent_rt.llama_index.vector_stores.qdrant.QdrantVectorStore |
llama_index.vector_stores.milvus.MilvusVectorStore | agent_rt.llama_index.vector_stores.milvus.MilvusVectorStore |
llama_index.vector_stores.weaviate.WeaviateVectorStore | agent_rt.llama_index.vector_stores.weaviate.WeaviateVectorStore |
from agent_rt.llama_index.vector_stores.qdrant import QdrantVectorStore
from agent_rt.llamaindex import VectorStoreIndex
vector_store = QdrantVectorStore()
index = VectorStoreIndex.from_vector_store(
vector_store,
embed_model=embed_model,
)
nodes = await index.as_retriever(
similarity_top_k=4,
).aretrieve("How does Agent RT migrate vector retrieval?")
TypeScript/JavaScript equivalents are published at agent-rt/@llamaindex/chroma, agent-rt/@llamaindex/pinecone, agent-rt/@llamaindex/qdrant, agent-rt/@llamaindex/milvus, and agent-rt/@llamaindex/weaviate.
import {
QdrantVectorStore,
VectorStoreIndex,
} from "agent-rt/@llamaindex/qdrant";
const vectorStore = new QdrantVectorStore();
const index = VectorStoreIndex.fromVectorStore(vectorStore, {
embedModel,
});
const nodes = await index.asRetriever({
similarityTopK: 4,
}).retrieve("How does Agent RT migrate vector retrieval?");
AGENT_RT_VECTOR_DB.Embedding queries
Vector databases search numeric embeddings while Agent RT retrieval queries are text-first. Supply an EmbeddingModelProvider when registering the built-in backends. OpenAI and OpenAI-compatible Agent RT providers support embeddings. If your application already creates embeddings elsewhere, pass a numeric filters.vector instead.
await provider.search(
RetrievalQuery(
"precomputed query",
filters={"vector": [0.12, -0.03, 0.44]},
)
)
await provider.search({
text: "precomputed query",
filters: { vector: [0.12, -0.03, 0.44] },
});
Backend options
| Backend | Example option | Purpose |
|---|---|---|
| Chroma | AGENT_RT_VECTOR_DB_OPTION_TENANTAGENT_RT_VECTOR_DB_OPTION_DATABASE | Select Chroma tenant and database. |
| Pinecone | AGENT_RT_VECTOR_DB_OPTION_NAMESPACE | Select a Pinecone namespace. |
| Milvus | AGENT_RT_VECTOR_DB_OPTION_FILTER | Pass a Milvus filter expression. |
| Weaviate | AGENT_RT_VECTOR_DB_OPTION_CONTENT_FIELDAGENT_RT_VECTOR_DB_OPTION_TITLE_FIELDAGENT_RT_VECTOR_DB_OPTION_URI_FIELD | Map your schema fields into Agent RT retrieval results. |
Runnable examples
See python/examples/07_vector_db.py and typescript/examples/07_vector_db.js in the repository. Both examples use the same environment-driven backend selection shown above.