Skip to main content
Async knowledge stores provide non-blocking vector storage and semantic search so native-async RAG backends never block the event loop.
The agent runs a semantic search; an async knowledge store queries the vector backend without blocking other agents on the same loop.

Quick Start

1

Subclass AsyncKnowledgeStore

Implement a native-async vector backend by inheriting from AsyncKnowledgeStore:
2

Wire It Into an Agent

Pass the store through the persistence config so the agent dispatches async calls natively:
These ABCs give third-party native-async backends a formal interface to subclass. Shipped async backends still subclass the sync KnowledgeStore and route through run_sync wrappers; they will migrate onto the async ABC in a follow-up PR. Dispatch via PraisonAIDB._dispatch_async continues to work for both styles.

How It Works

A sync caller inside a running loop dispatches to the async store through PraisonAIDB._dispatch_async.

Abstract Methods

The ABC also ships __aenter__ / __aexit__ for async with usage.

Configuration Options

Persistence API Reference

Complete method signatures for AsyncKnowledgeStore and sibling stores

Common Patterns

Custom Async Backend Inheritance

Subclass AsyncKnowledgeStore (not KnowledgeStore) when your vector backend is natively async:

async with Context Manager

The ABC defines __aenter__ / __aexit__, so async with closes the store automatically:
Query by embedding with an optional score threshold and metadata filters:

Best Practices

Inherit the async ABC so isinstance() dispatch awaits your methods directly:
Use async with or await store.close() to release connections:
Keep a single store async end-to-end:

Async State Store

Sibling async pattern for key-value state

Async Conversation Store

Sibling async pattern for conversation sessions