rig-core-v0.37.0
0xPlaygrounds/rigrig-core-v0.37.0May 13, 2026by github-actions[bot]
AI Summary
Major update introducing memory management features, STT/TTS support, and various provider enhancements.
Key Highlights
- Added transcription (STT) and audio generation (TTS) support via OpenRouter
- Introduced Compactor trait and CompactingMemory adapter for intelligent memory management
- Enhanced Ollama think parameter with string levels
- Added Rig-managed conversation memory with companion crate
- Added copilot model listing
Breaking Changes
- Make Chat append messages to caller history
New Features
- STT and TTS support for OpenRouter
- Compactor trait and CompactingMemory adapter
- Enhanced think parameter for Ollama
- Rig-managed conversation memory
- Structured output support for OpenRouter
- PDF Documents as file parts in chat completions
- Token usage telemetry improvements
Full Release Notes
### Added
- *(openrouter)* add transcription (STT) and audio generation (TTS) support ([#1757](https://github.com/0xPlaygrounds/rig/pull/1757)) (by @fversaci)
- *(memory)* add Compactor trait, CompactingMemory adapter, and TemplateCompactor ([#1748](https://github.com/0xPlaygrounds/rig/pull/1748)) (by @ForeverAngry)
- *(ollama)* Enhance `think` parameter with string levels ([#1747](https://github.com/0xPlaygrounds/rig/pull/1747)) (by @cobaltburn)
- *(memory)* Rig-managed conversation memory + rig-memory companion crate ([#1702](https://github.com/0xPlaygrounds/rig/pull/1702)) (by @ForeverAngry)
- add copilot model listing ([#1700](https://github.com/0xPlaygrounds/rig/pull/1700)) (by @BigtoC) - #1700
### Fixed
- *(gemini)* Token usage correctness for posthog llm analytics ([#1761](https://github.com/0xPlaygrounds/rig/pull/1761)) (by @mateobelanger)
- *(openrouter)* skip serializing empty content in Assistant messages ([#1735](https://github.com/0xPlaygrounds/rig/pull/1735)) (by @pablof7z)
- *(openai)* send PDF Documents as file parts in chat completions ([#1732](https://github.com/0xPlaygrounds/rig/pull/1732)) (by @fangkangmi)
- *(core)* [**breaking**] make Chat append messages to caller history ([#1733](https://github.com/0xPlaygrounds/rig/pull/1733)) (by @gold-silver-copper)
- added a trailing newline after streamed agent response. The AgentImpl::request method streams tokens using print! macro with no trailing newline, so when the stream ends, the run loop prints the closing separator immediately which causes it to appear on the same line as the last response token - So added a println!() to the None arm of the streaming loop so a newline is always emitted after the final chunk which matches the ChatImpl path that uses println. ([#1712](https://github.com/0xPlaygrounds/rig/pull/1712)) (by @Shaurya-Sethi) - #1712
- *(mistral)* expose cached and audio token fields in Usage ([#1725](https://github.com/0xPlaygrounds/rig/pull/1725)) (by @byQuexo)
### Other
- Clean up root facade features and integration docs ([#1764](https://github.com/0xPlaygrounds/rig/pull/1764)) (by @gold-silver-copper) - #1764
- Improve GenAI token usage telemetry for Gemini and Responses API ([#1762](https://github.com/0xPlaygrounds/rig/pull/1762)) (by @gold-silver-copper) - #1762
- Memory adapter cancellation safety and trait-object forwarding ([#1756](https://github.com/0xPlaygrounds/rig/pull/1756)) (by @gold-silver-copper) - #1756
- Add demotion hooks for bounded conversation memory ([#1737](https://github.com/0xPlaygrounds/rig/pull/1737)) (by @ForeverAngry) - #1737
- Move reusable test doubles into rig_core::test_utils ([#1745](https://github.com/0xPlaygrounds/rig/pull/1745)) (by @gold-silver-copper) - #1745
- workspace and docs cleanup ([#1742](https://github.com/0xPlaygrounds/rig/pull/1742)) (by @gold-silver-copper) - #1742
- openrouter vars ([#1741](https://github.com/0xPlaygrounds/rig/pull/1741)) (by @gold-silver-copper) - #1741
- Add provider file ID support for document inputs ([#1740](https://github.com/0xPlaygrounds/rig/pull/1740)) (by @gold-silver-copper) - #1740
- bump dependencies ([#1728](https://github.com/0xPlaygrounds/rig/pull/1728)) (by @gold-silver-copper) - #1728
- Add a support of structured output for OpenRouter ([#1718](https://github.com/0xPlaygrounds/rig/pull/1718)) (by @Mnwa) - #1718
- set doctest to true, and update doc comments ([#1716](https://github.com/0xPlaygrounds/rig/pull/1716)) (by @gold-silver-copper) - #1716
- AGENTS.MD, CONTRIBUTING.MD, and docs ([#1714](https://github.com/0xPlaygrounds/rig/pull/1714)) (by @gold-silver-copper) - #1714
- improve project organization and create rig crate ([#1699](https://github.com/0xPlaygrounds/rig/pull/1699)) (by @gold-silver-copper) - #1699
### Contributors
* @gold-silver-copper
* @fversaci
* @mateobelanger
* @ForeverAngry
* @cobaltburn
* @pablof7z
* @fangkangmi
* @BigtoC
* @Shaurya-Sethi
* @Mnwa
* @byQuexo
### Added
- `rig::memory::Compactor` trait. A `Compactor` produces a single
`Message`-shaped `Artifact` from a slice of messages a memory policy
has evicted, optionally combining it with the previous summary
(`carry_over`) for rolling-summary semantics. Where `DemotionHook`
is a one-way drain that observes evicted messages, `Compactor` is
the inverse: it returns an artifact that the composing adapter
splices back into the active history, so the loaded prompt shape is
`[summary, ...recent_window]` instead of a verbatim suffix. The
trait lives in `rig_core` so any memory backend can implement it
without taking a `rig-memory` dependency; the composing
`CompactingMemory` adapter and a zero-dependency `TemplateCompactor`
reference implementation live in `rig-memory`. Implementations with
durable side effects (LLM calls, vector-store writes) must
deduplicate per the same idempotency contract as `DemotionHook`,
since per-conversation watermarks are in-process only.
- Rig-managed conversation memory:
- New `rig::memory` module with the `ConversationMemory` trait,
`MemoryError` (with a `MemoryBackendError` source type),
`MessageFilter` trait, and a default `InMemoryConversationMemory` backend
with optional `with_filter` for shaping loaded history.
- `AgentBuilder::memory(...)` and `AgentBuilder::conversation_id(...)` to
attach a backend and an optional default conversation id to an agent.
- `PromptRequest::conversation(id)` and `PromptRequest::without_memory()`
(mirrored on the streaming builder) to control memory per-request.
- `From<MemoryError> for PromptError` and `From<MemoryError> for
StreamingError` so memory failures propagate via `?` through the existing
`CompletionError::RequestError(Box<dyn Error>)` variant — no new
top-level error variants, fully additive change.
- `memory.append(...)` failures after a successful completion are
best-effort: they emit `tracing::warn!` and the agent still returns the
model response (parity for streaming `FinalResponse`). `memory.load(...)`
failures remain fatal because the requested history is unavailable.
- Examples: `agent_with_memory.rs` and `agent_with_memory_streaming.rs`.
- Named history-shaping policies (sliding window, token budget) live in the
new companion crate `rig-memory`.
- `rig::memory::DemotionHook` trait and `NoopDemotionHook` no-op default.
Side-channel for messages that a memory policy or adapter removes from
active history. Defined in `rig-core` so any memory backend can implement
it without a `rig-memory` dependency; the composing
`DemotingPolicyMemory<M, P, H>` adapter lives in `rig-memory`. Includes a
forwarding `impl<H: DemotionHook + ?Sized> DemotionHook for Arc<H>` so
hooks can be shared across multiple adapters.
- `MemoryError::Internal(String)` variant for in-process invariant
violations (e.g. poisoned mutex guards), distinct from
`MemoryError::Backend` which is reserved for failures of the underlying
conversation store. `MemoryError` is now `#[non_exhaustive]` so future
variants are not breaking changes.
**Note for downstream crates:** `MemoryError` was previously a plain
enum, so any existing `match` against it without a wildcard arm will
now warn (and may need a wildcard arm if it was upgraded to a hard
error elsewhere). Adding `_ => ...` is forward-compatible with future
variants.