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 throughPraisonAIDB._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 storesCommon Patterns
Custom Async Backend Inheritance
SubclassAsyncKnowledgeStore (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:
Semantic Search
Query by embedding with an optional score threshold and metadata filters:Best Practices
Subclass AsyncKnowledgeStore for Native-Async Backends
Subclass AsyncKnowledgeStore for Native-Async Backends
Inherit the async ABC so
isinstance() dispatch awaits your methods directly:Always Close the Store
Always Close the Store
Use
async with or await store.close() to release connections:Don't Mix Sync and Async Methods
Don't Mix Sync and Async Methods
Keep a single store async end-to-end:
Related
Async State Store
Sibling async pattern for key-value state
Async Conversation Store
Sibling async pattern for conversation sessions

