Skip to main content
Store and retrieve text embeddings so your agent can recall relevant content instantly.
The user asks about indexed docs; the agent retrieves matching chunks from the vector store.

Quick Start

1

Agent with Knowledge

Give your agent a knowledge base — it automatically indexes and searches it for every question.
2

Choose a Persistent Backend

Switch to a database backend so knowledge survives restarts.
3

Direct Registry Usage

Access the in-memory store directly to add and query vectors.
get_vector_store_registry is not re-exported from the top-level package — use the full module path below.

Which Backend Should I Use?



Registering the Chroma / Pinecone adapters

Importing praisonai.adapters.vector_stores no longer auto-registers ChromaVectorStore / PineconeVectorStore into the core SDK vector-store registry. If you want these adapters wired in — for example so KnowledgeConfig(vector_store={"provider": "chroma"}) picks up the wrapper’s Chroma implementation — call the explicit hook once:
This was previously a side effect of import praisonai.adapters.vector_stores. Removing it means the wrapper no longer mutates a core-SDK registry as an import side effect, and does not probe for chromadb / pinecone on disk unless the caller explicitly asks. The change is backward-compatible for callers that already use praisonaiagents.knowledge directly with their own VectorStoreProtocol implementations.

How It Works

A user question flows through the agent to the vector store, which finds the closest matching content using cosine similarity.

Configuration Options

Vector Store API Reference

Full API reference for VectorRecord, VectorStoreProtocol, VectorStoreRegistry, and InMemoryVectorStore

VectorRecord Fields

VectorStoreProtocol Methods


Common Patterns

Plug into an Agent’s Knowledge

Wire a registered custom store into an agent via KnowledgeConfig.

Custom Backend: Minimum Viable Adapter

Any class with these five methods and a name attribute works as a drop-in backend.

Filter by Metadata

Narrow query results to records that match specific metadata fields.

Multi-Tenant Namespaces

Isolate data for different users or projects within the same store.

Delete Vectors

Remove specific records, filter-matched records, or all records in a namespace.

Best Practices

InMemoryVectorStore (registered as "memory") is ideal for development, testing, and short-lived agents. It requires no external dependencies and resets on process restart. Switch to a persistent backend when you need data to survive restarts or to scale beyond a single process.
Upgrade when any of these apply: data must survive a process restart, multiple processes need the same store, you have more than ~100k vectors, you need filtered queries at scale, or you are running in a multi-user environment. Chroma and LanceDB are good first steps — they write to disk with no server required.
Use namespaces to isolate data by user, project, or run — "user:alice", "project:docs-v2", "run:abc123". A well-chosen namespace strategy lets you share a single store instance while keeping data strictly separated, and makes bulk deletion straightforward with delete_all=True.
InMemoryVectorStore ranks results by cosine similarity. Cosine similarity measures angle, not magnitude, so two vectors pointing in the same direction score 1.0 regardless of length. If your embedding model already normalises output vectors (most do), results will be reliable. If not, normalise manually before calling add and query to avoid misleading scores. Mismatched embedding lengths return score 0.0.
Any object that satisfies VectorStoreProtocol can be registered. Implement the five methods (add, query, delete, count, get) and a name attribute, then call registry.register("my_backend", factory). The registry caches instances per name:namespace key, so the factory is called only once per combination. Failures during initialization are logged and return None rather than raising.

Knowledge Base

How agents load and search knowledge sources

Knowledge Backends

Choose Chroma, LanceDB, Pinecone, and other backends