Skip to main content

Crate agent_context_contract

Crate agent_context_contract 

Source
Expand description

HTTP API contract for the Context service.

§Why this service exists

Conversation history is durable, cross-turn state. A Runtime must be able to read and append it without owning a database and without holding a platform service secret. Giving history its own service does for history what agent-workspace-infra does for sandboxes: one owner, one HTTP contract, one deployable.

§Layering

agent-context-contract   paths + DTOs        (this crate)
agent-context-runtime    store implementation
agent-context-server     router + auth + bin

See api.md for the full HTTP reference.

Structs§

ApiError
Error body shared by every non-2xx response.
AppendMessagesRequest
AppendResponse
Result of an append. appended excludes ids that already existed, so a caller can tell a fresh write from a deduplicated retry.
AppendSessionRequest
AuthorizedScope
Scope derived from a verified gateway-issued internal credential.
ContextDerivation
ContextExportArtifact
ContextExportArtifactChunk
ContextInsight
ContextMaintenanceStatus
ContextOperation
ContextProvenance
ContextWindow
ContextWindowItem
One ordered item that was actually visible to the model.
ConversationRecord
One durable conversation message.
ConversationScope
Identifies the conversation a record belongs to.
ConversationSummary
ConversationsResponse
CorrectContextInsightRequest
CreateContextDerivationRequest
CreateContextWindowRequest
DeleteConversationRequest
DeletionOperation
ExpireContextInsightRequest
ExportContextRequest
GetContextExportArtifactChunkRequest
GetContextExportArtifactRequest
GetContextInsightRequest
GetContextOperationRequest
GetContextWindowRequest
GetDeletionOperationRequest
GetModelInvocationRequest
ImportContextRequest
IndexWatermark
KnowledgeEvidence
The smallest replayable external-knowledge record. References are opaque to Context Infra and never imply ownership of the provider’s source document.
ListConversationsRequest
Agent-scoped conversation directory query.
ListSessionsRequest
MergeContextInsightsRequest
MessageCursor
Stable opaque cursor position for (sequence ASC, id ASC) ordering.
MessagePage
MessagesResponse
Records in chronological order, oldest first.
ModelInvocation
Audit record for the exact request snapshot supplied to one model call.
PageMessagesRequest
PutContextInsightRequest
PutModelInvocationRequest
ReadSessionRequest
RebuildVectorProjectionRequest
RecallContextRequest
RecallContextResponse
RecallScoreBreakdown
RecalledContext
RecentMessagesRequest
RetentionPolicy
RetentionRequest
SearchMessagesRequest
SessionLogDirectory
SessionLogPage
SessionLogSnapshot

Enums§

ContextDerivationKind
ContextInsightKind
ContextInsightStatus
ContextOperationKind
ContextOperationState
ContextWindowItemKind
ContextWindowStage
ModelInvocationState

Constants§

AUDIENCE
CONTEXT_ADVANCED_OPERATIONS_PATH
CONTEXT_CORRECT_PATH
CONTEXT_EXPIRE_PATH
CONTEXT_EXPORT_ARTIFACT_CHUNK_PATH
CONTEXT_EXPORT_ARTIFACT_PATH
CONTEXT_EXPORT_PATH
CONTEXT_IMPORT_PATH
CONTEXT_INSIGHTS_PATH
CONTEXT_INSIGHT_GET_PATH
CONTEXT_MERGE_PATH
CONTEXT_OPERATIONS_PATH
CONTEXT_RECALL_PATH
CONVERSATIONS_LIST_PATH
CONVERSATION_DELETE_PATH
DEFAULT_PAGE_SIZE
Default page size when a request omits limit.
DEFAULT_PORT
DERIVATIONS_PATH
HEALTH_PATH
MAINTENANCE_STATUS_PATH
MAX_APPEND_BYTES
Maximum serialized payload bytes accepted by one atomic append.
MAX_APPEND_MESSAGES
Maximum number of records accepted by one atomic append.
MAX_PAGE_SIZE
Upper bound the server enforces on any page size.
MAX_RESOURCE_ID_CHARS
MAX_SEARCH_QUERY_BYTES
MAX_WINDOW_BYTES
MAX_WINDOW_ITEMS
MESSAGES_APPEND_PATH
MESSAGES_PAGE_PATH
MESSAGES_RECENT_PATH
MESSAGES_SEARCH_PATH
MODEL_INVOCATIONS_PATH
MODEL_INVOCATION_GET_PATH
RETENTION_PATH
SERVICE_NAME
SERVICE_TOKEN_ENV
Optional static service token. When unset, the server runs in open mode.
SESSION_APPEND_PATH
SESSION_LIST_PATH
SESSION_READ_PATH
VECTOR_REBUILD_PATH
WINDOWS_PATH
WINDOW_GET_PATH

Functions§

content_text
Extract plain text from a message content value.