vector_store.provider.
Quick Start
1
Register and use a custom backend
Register your adapter class, then point an Agent’s Knowledge at it.
2
Lazy-load heavy backends with a factory
Use a factory when the backend imports heavy dependencies you want to defer.
How It Works
The Agent readsvector_store.provider, looks it up in the registry, and calls your adapter — mem0-normalised results flow back to the user.
Pick the right path — a built-in adapter or a custom one.
Protocol Contract
Your adapter implementsKnowledgeStoreProtocol. The minimum method set is store, search, and delete, each accepting the scope kwargs user_id, agent_id, and run_id.
Registration APIs
Four public functions inpraisonaiagents.knowledge.adapters manage the registry.
When Registration Must Run
Register before the firstAgent(...) or Knowledge(...) call reads .memory. Import-time registration is fine; deferred registration must beat the cached_property that resolves the adapter.
Best Practices
Register at import time
Register at import time
Put
register_knowledge_adapter(...) at module top level so it runs before any Agent resolves its knowledge backend.Use a factory for heavy dependencies
Use a factory for heavy dependencies
When the backend imports heavy libraries, register a factory so the import defers until the adapter is actually needed.
Accept the scope kwargs
Accept the scope kwargs
Always accept
user_id, agent_id, and run_id in store, search, and delete — the Agent passes them for multi-tenant isolation.Verify with has_knowledge_adapter before use
Verify with has_knowledge_adapter before use
Call
has_knowledge_adapter("your_name") in tests to confirm registration ran before the first Agent call.Related
Knowledge Backends
Built-in providers and the supported-provider table
Vector Store
Store and query embeddings with a pluggable backend

