Repository navigation
Releases
Releases · redai-studio/ravelin
Ravelin 0.8.0
Initial public release of Ravelin, a Python SDK for attaching portable runtime resources, streaming, and durable execution to application-defined flows. Ravelin is beta software. Its current component and pipeline integration is Haystack; applications own workflow semantics, authorization, and permanent product history.
Features
- Asset references, registered resolvers, and typed secret handling separate serialized component configuration from environment-specific resources. Built-in adapters cover chat and embedding models, Milvus, web search, and web scraping. See assets.
- Haystack-compatible components provide chat generation, tool-using agents, retrieval, ranking, prompt construction, and document preprocessing, with extended message and streaming data models.
- Streaming sessions, backend buffers, and relay helpers provide live events, inclusive cursor replay, and catch-up for active generations. Application journal hooks expose lifecycle and activity events for durable storage. Redis subscriptions to a run that has already closed finish instead of waiting. See streaming.
- Optional Restate integration provides durable component calls and explicit substeps, configurable failure classification, and approval waits with typed response validation. Values passed between
RestatePipelinecomponents may bedatetime,date,time,timedelta,Decimal,UUID,bytes,set,frozensetorEnumand are restored as the same type.max_runs_per_componentis enforced as in Haystack'sPipeline. See durability.
Requirements
- Python 3.10 or later and Haystack 2.26.x are required. Install the
milvus,redis,restate, ortracingextras for the integrations you use. The Milvus adapter targets 2.5.x APIs with PyMilvus 2.5.x; the tracing integration requires Langfuse and langfuse-haystack 3.x. - Serializable components need asset references. Local asset files accept environment-variable secret descriptors, not plaintext credentials or runtime token secrets. Token secrets cannot be serialized or saved. Local asset names are relative, forward-slash-separated paths that must resolve inside the configured storage directory. See asset-resolution for resolver trust and secret rules.
- Configure model deployment roots with
base_urland operation paths withroutes. HTTPX-based assets create their clients lazily and reuse them across calls, with one asynchronous client per event loop; close them withclose()andaclose()at shutdown. When driving an asset from short-lived event loops, awaitaclose()before each loop ends. Local retry settings apply outside Restate; Restate owns retry orchestration inside its context. OpenAI-compatible endpoints without streaming usage support requiresupport_stream_options=False. Token streaming supports one completion per request. See assets. - Approval responses must match the declared payload type. Ordinary dataclasses allow extra fields but require valid mandatory fields and types. Custom decoders keep precedence and their errors propagate. The executor resolver requires a non-empty
awakeable_idand an explicitpayload; invalid response bytes fail terminally at the waiter. See durability. RestatePipelineinputs are encoded again on every replay and must be deterministic. Component inputs and outputs must be JSON-encodable or one of the supported types; a value that cannot be encoded fails the workflow with aTerminalErrornaming the field. See durability.- Journal hooks require asynchronous emission. Use
streaming_session_async()withAsyncPipelineorRestatePipeline;streaming_session()rejectson_journal_event, and a synchronous lifecycle or component-activity emit raisesRuntimeErrorwhile a hook is configured. See streaming.
Design boundaries
- Streaming retention and active-generation snapshots support live delivery and reconnection; applications own permanent product history. Reconnect cursors are inclusive, so clients must handle the repeated boundary event.
- Recovery protects declared durable boundaries. External side effects and application journal writes need idempotency or appropriate durable protection; Ravelin does not guarantee exactly-once external effects.
- Provider features, streaming options, and observability metadata vary by deployment. Applications select and validate the provider capabilities they require.
Install
pip install ravelin