rig-core-v0.37.0
Added
- (openrouter) add transcription (STT) and audio generation (TTS) support (#1757) (by @fversaci)
- (memory) add Compactor trait, CompactingMemory adapter, and TemplateCompactor (#1748) (by @ForeverAngry)
- (ollama) Enhance
thinkparameter with string levels (#1747) (by @cobaltburn) - (memory) Rig-managed conversation memory + rig-memory companion crate (#1702) (by @ForeverAngry)
- add copilot model listing (#1700) (by @BigtoC) - #1700
Fixed
- (gemini) Token usage correctness for posthog llm analytics (#1761) (by @mateobelanger)
- (openrouter) skip serializing empty content in Assistant messages (#1735) (by @pablof7z)
- (openai) send PDF Documents as file parts in chat completions (#1732) (by @fangkangmi)
- (core) [breaking] make Chat append messages to caller history (#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) (by @Shaurya-Sethi) - #1712
- (mistral) expose cached and audio token fields in Usage (#1725) (by @byQuexo)
Other
- Clean up root facade features and integration docs (#1764) (by @gold-silver-copper) - #1764
- Improve GenAI token usage telemetry for Gemini and Responses API (#1762) (by @gold-silver-copper) - #1762
- Memory adapter cancellation safety and trait-object forwarding (#1756) (by @gold-silver-copper) - #1756
- Add demotion hooks for bounded conversation memory (#1737) (by @ForeverAngry) - #1737
- Move reusable test doubles into rig_core::test_utils (#1745) (by @gold-silver-copper) - #1745
- workspace and docs cleanup (#1742) (by @gold-silver-copper) - #1742
- openrouter vars (#1741) (by @gold-silver-copper) - #1741
- Add provider file ID support for document inputs (#1740) (by @gold-silver-copper) - #1740
- bump dependencies (#1728) (by @gold-silver-copper) - #1728
- Add a support of structured output for OpenRouter (#1718) (by @Mnwa) - #1718
- set doctest to true, and update doc comments (#1716) (by @gold-silver-copper) - #1716
- AGENTS.MD, CONTRIBUTING.MD, and docs (#1714) (by @gold-silver-copper) - #1714
- improve project organization and create rig crate (#1699) (by @gold-silver-copper) - #1699
Contributors
- @gold-silver-copper
- @fversaci
- @mateobelanger
- @ForeverAngry
- @cobaltburn
- @pablof7z
- @fangkangmi
- @BigtoC
- @Shaurya-Sethi
- @Mnwa
- @byQuexo
Added
-
rig::memory::Compactortrait. ACompactorproduces a single
Message-shapedArtifactfrom a slice of messages a memory policy
has evicted, optionally combining it with the previous summary
(carry_over) for rolling-summary semantics. WhereDemotionHook
is a one-way drain that observes evicted messages,Compactoris
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 inrig_coreso any memory backend can implement it
without taking arig-memorydependency; the composing
CompactingMemoryadapter and a zero-dependencyTemplateCompactor
reference implementation live inrig-memory. Implementations with
durable side effects (LLM calls, vector-store writes) must
deduplicate per the same idempotency contract asDemotionHook,
since per-conversation watermarks are in-process only. -
Rig-managed conversation memory:
- New
rig::memorymodule with theConversationMemorytrait,
MemoryError(with aMemoryBackendErrorsource type),
MessageFiltertrait, and a defaultInMemoryConversationMemorybackend
with optionalwith_filterfor shaping loaded history. AgentBuilder::memory(...)andAgentBuilder::conversation_id(...)to
attach a backend and an optional default conversation id to an agent.PromptRequest::conversation(id)andPromptRequest::without_memory()
(mirrored on the streaming builder) to control memory per-request.From<MemoryError> for PromptErrorandFrom<MemoryError> for StreamingErrorso 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 emittracing::warn!and the agent still returns the
model response (parity for streamingFinalResponse).memory.load(...)
failures remain fatal because the requested history is unavailable.- Examples:
agent_with_memory.rsandagent_with_memory_streaming.rs. - Named history-shaping policies (sliding window, token budget) live in the
new companion craterig-memory.
- New
-
rig::memory::DemotionHooktrait andNoopDemotionHookno-op default.
Side-channel for messages that a memory policy or adapter removes from
active history. Defined inrig-coreso any memory backend can implement
it without arig-memorydependency; the composing
DemotingPolicyMemory<M, P, H>adapter lives inrig-memory. Includes a
forwardingimpl<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::Backendwhich is reserved for failures of the underlying
conversation store.MemoryErroris now#[non_exhaustive]so future
variants are not breaking changes.Note for downstream crates:
MemoryErrorwas previously a plain
enum, so any existingmatchagainst 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.