Documentation
¶
Overview ¶
Package memscope carries a memory scope — the tenant and subject a turn's memory operations are attributed to — through a context.Context.
It exists so a caller that owns the scoping decision (e.g. the team chats service, which knows a turn runs on behalf of a specific chat) can stamp the scope onto the turn context, and the consumers of that scope (the agent's automatic recall/rollover memory and the memory skill's tools) can honor it without either side depending on the other. This decouples "where a memory belongs" from "who runs the turn": the agent needs no knowledge of chats, and chats needs no knowledge of the agent's memory internals.
A chat turn is scoped TenantID=<team tenant>, SubjectID="chat:<id>" so a chat's memories are isolated to that chat (RMI-OMNIAGENT-114). When no scope is set (personal CLI, non-chat turns), consumers fall back to their own configuration, so behavior is unchanged.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a context carrying scope. An entirely empty scope is a no-op — it returns ctx unchanged so consumers still resolve their defaults.
Types ¶
type Scope ¶
type Scope struct {
// TenantID is the memory tenant (e.g. "team"). Empty leaves the
// consumer's configured tenant in place.
TenantID string
// SubjectID is who/what the memory is about (e.g. "chat:<id>"). Empty
// leaves the consumer's default subject in place.
SubjectID string
}
Scope identifies the tenant and subject a turn's memory operations belong to. A zero-valued field means "unset" — a consumer keeps its own default for that field, so a scope may override the tenant, the subject, or both.