Parent
#27
What to build
Convert all KnowledgeBase lifecycle methods and outgoing KI calls to async def, completing the migration of the public API surface.
Lifecycle methods: connect(), register(), unregister(), sync_knowledge_interactions() all become async def. They now await the underlying async Client methods.
Outgoing calls: ask() and post() become async def. They await the client's async ask()/post() methods. This enables making multiple outgoing KI calls concurrently via asyncio.gather().
Handler invocation: call() becomes async def, awaiting the now-async dispatch().
Close: Add a close() method to KnowledgeBase that delegates to self.client.close() to properly shut down the httpx.AsyncClient.
Builder: KnowledgeBaseBuilder.build() stays synchronous — it configures and returns a KnowledgeBase whose lifecycle methods are then called asynchronously by the user. Minor adjustments may be needed if build() calls any methods that are now async.
Acceptance criteria
Blocked by
Parent
#27
What to build
Convert all
KnowledgeBaselifecycle methods and outgoing KI calls toasync def, completing the migration of the public API surface.Lifecycle methods:
connect(),register(),unregister(),sync_knowledge_interactions()all becomeasync def. They nowawaitthe underlying asyncClientmethods.Outgoing calls:
ask()andpost()becomeasync def. Theyawaitthe client's asyncask()/post()methods. This enables making multiple outgoing KI calls concurrently viaasyncio.gather().Handler invocation:
call()becomesasync def, awaiting the now-asyncdispatch().Close: Add a
close()method toKnowledgeBasethat delegates toself.client.close()to properly shut down thehttpx.AsyncClient.Builder:
KnowledgeBaseBuilder.build()stays synchronous — it configures and returns aKnowledgeBasewhose lifecycle methods are then called asynchronously by the user. Minor adjustments may be needed ifbuild()calls any methods that are now async.Acceptance criteria
connect(),register(),unregister(),sync_knowledge_interactions()areasync defask()andpost()areasync defcall()isasync defclose()method added toKnowledgeBase, delegates to clientKnowledgeBaseBuilder.build()remains synchronousuv run ruff check .passesBlocked by