Skip to main content
Register a custom knowledge backend under any provider name, then use it from an Agent through 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 reads vector_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 implements KnowledgeStoreProtocol. The minimum method set is store, search, and delete, each accepting the scope kwargs user_id, agent_id, and run_id.
No base-class inheritance is required — any class matching the protocol works.

Registration APIs

Four public functions in praisonaiagents.knowledge.adapters manage the registry.

When Registration Must Run

Register before the first Agent(...) or Knowledge(...) call reads .memory. Import-time registration is fine; deferred registration must beat the cached_property that resolves the adapter.
An explicit provider that isn’t registered raises ValueError listing the valid names. Register the adapter first, or the Agent fails fast instead of silently degrading to Mem0.

Best Practices

Put register_knowledge_adapter(...) at module top level so it runs before any Agent resolves its knowledge backend.
When the backend imports heavy libraries, register a factory so the import defers until the adapter is actually needed.
Always accept user_id, agent_id, and run_id in store, search, and delete — the Agent passes them for multi-tenant isolation.
Call has_knowledge_adapter("your_name") in tests to confirm registration ran before the first Agent call.

Knowledge Backends

Built-in providers and the supported-provider table

Vector Store

Store and query embeddings with a pluggable backend