Skip to main content

Module memory

Module memory 

Source
Expand description

Context / memory providers.

Rust equivalent of agent_framework._memory. A ContextProvider injects extra instructions, messages, and tools into an agent invocation without persisting them to the conversation history.

Upstream renamed ContextProvider.invoking/invoked to before_run/ after_run and removed the thread_created hook entirely; before_run mutates a SessionContext in place instead of returning a value. There is no aggregate wrapper any more — consumers hold a Vec<Arc<dyn ContextProvider>> and iterate it directly.

Structs§

AgentInfo
The identity of the agent a SessionContext belongs to.
SessionContext
Per-invocation context a provider contributes to a run. Providers mutate this in place in before_run. Rust equivalent of upstream SessionContext.

Constants§

ATTRIBUTION_KEY
The Message::additional_properties key carrying a context message’s source attribution: {"source_id", "source_type"?, "origin_session_ids"?} (upstream _attribution). The run’s own input carries none.

Traits§

ContextProvider
A source of per-invocation context (memory, RAG, etc.). Upstream renamed invoking/invoked -> before_run/after_run and REMOVED thread_created. before_run mutates the SessionContext in place instead of returning a Context.

Functions§

attribute_message
Tag message as contributed by source_id, merging with any attribution it already carries (an existing source_id/source_type is kept; origin session ids accumulate without duplicates).
message_source_id
The source a context message was attributed to, if any.
message_source_type
The type of the source a message was attributed to, if any (upstream GetAgentRequestMessageSourceType).
with_message_source
Tag message with a source (upstream WithAgentRequestMessageSource), returning it.