Description
Add an AsyncRAGPipeline (or async_ingest / async_query methods on RAGPipeline) so the pipeline can be awaited in async web frameworks like FastAPI and Starlette.
Motivation
Synchronous pipelines block the event loop when used inside async frameworks. Async support is essential for production API services that need to handle concurrent requests without spinning up threads.
Acceptance criteria
Files to touch
ragframework/pipeline/async_rag.py — new file (or extend rag.py)
ragframework/base.py — optional: async ABCs
pyproject.toml — add pytest-asyncio to [dev]
tests/test_pipeline/test_async_rag.py — new test file
examples/async_rag.py — new example
Resources
Description
Add an
AsyncRAGPipeline(orasync_ingest/async_querymethods onRAGPipeline) so the pipeline can be awaited in async web frameworks like FastAPI and Starlette.Motivation
Synchronous pipelines block the event loop when used inside async frameworks. Async support is essential for production API services that need to handle concurrent requests without spinning up threads.
Acceptance criteria
AsyncRAGPipelineinragframework/pipeline/async_rag.pyorasync_ingest/async_querymethods added toRAGPipelineragframework/base.py:AsyncEmbedder,AsyncRetriever,AsyncGenerator— or useasyncio.to_threadto wrap sync implementationspytest-asyncio— add it to[dev]extra inpyproject.tomlexamples/async_rag.pyshowing usage withasyncio.run()CHANGELOG.mdupdated under[Unreleased]Files to touch
ragframework/pipeline/async_rag.py— new file (or extendrag.py)ragframework/base.py— optional: async ABCspyproject.toml— addpytest-asyncioto[dev]tests/test_pipeline/test_async_rag.py— new test fileexamples/async_rag.py— new exampleResources