Plug-and-play boilerplate that wires real-time events to any embedding model and any vector store.
RagPipeline (sync) and AsyncRagPipeline (async) connect the Autoplay event stream to your vector store with minimal code.
You provide two functions — embed and upsert — and the pipeline handles the rest.
Attach a SessionSummarizer to automatically condense actions before embedding.
This keeps your vector store entries compact and your context window small.
from autoplay_sdk.rag import RagPipelinefrom autoplay_sdk.summarizer import SessionSummarizersummarizer = SessionSummarizer(llm=my_llm_fn, threshold=10)pipeline = RagPipeline( embed=embed_fn, upsert=upsert_fn, summarizer=summarizer, # actions go through summarizer first)client.on_actions(pipeline.on_actions).on_summary(pipeline.on_summary).run()
When the summarizer fires (every 10 actions), the LLM-generated summary is
embedded and upserted — not the raw action batch.