Agent RT Documentation
Documentation menu
Guides

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.

BackendAGENT_RT_VECTOR_DBCredential variableNotes
ChromachromaCHROMA_API_KEYOptional tenant/database options.
MilvusmilvusMILVUS_TOKENUses the Milvus REST vector search endpoint.
PineconepineconePINECONE_API_KEYOptional namespace via an option variable.
QdrantqdrantQDRANT_API_KEYUses collection point search.
WeaviateweaviateWEAVIATE_API_KEYField 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"
What changes?Only environment configuration. Your retrieval code continues to call the same Agent RT 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 PythonAgent RT Python
langchain_chroma.Chromaagent_rt.langchain_chroma.Chroma
langchain_pinecone.PineconeVectorStoreagent_rt.langchain_pinecone.PineconeVectorStore
langchain_qdrant.QdrantVectorStoreagent_rt.langchain_qdrant.QdrantVectorStore
langchain_milvus.Milvusagent_rt.langchain_milvus.Milvus
langchain_weaviate.WeaviateVectorStoreagent_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 PythonAgent RT Python
llama_index.vector_stores.chroma.ChromaVectorStoreagent_rt.llama_index.vector_stores.chroma.ChromaVectorStore
llama_index.vector_stores.pinecone.PineconeVectorStoreagent_rt.llama_index.vector_stores.pinecone.PineconeVectorStore
llama_index.vector_stores.qdrant.QdrantVectorStoreagent_rt.llama_index.vector_stores.qdrant.QdrantVectorStore
llama_index.vector_stores.milvus.MilvusVectorStoreagent_rt.llama_index.vector_stores.milvus.MilvusVectorStore
llama_index.vector_stores.weaviate.WeaviateVectorStoreagent_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?");
Compatibility scopeLangChain and LlamaIndex adapters support read/query operations against existing collections. Collection creation, ingestion/upsert, deletion, index administration, and vendor-specific sparse/hybrid lifecycle APIs remain backend-native. Use native Agent RT retrieval when you want backend selection to come entirely from 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

BackendExample optionPurpose
ChromaAGENT_RT_VECTOR_DB_OPTION_TENANT
AGENT_RT_VECTOR_DB_OPTION_DATABASE
Select Chroma tenant and database.
PineconeAGENT_RT_VECTOR_DB_OPTION_NAMESPACESelect a Pinecone namespace.
MilvusAGENT_RT_VECTOR_DB_OPTION_FILTERPass a Milvus filter expression.
WeaviateAGENT_RT_VECTOR_DB_OPTION_CONTENT_FIELD
AGENT_RT_VECTOR_DB_OPTION_TITLE_FIELD
AGENT_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.