Skip to main content

Crate rig_agentcore

Crate rig_agentcore 

Source
Expand description

Run a Rig agent on AWS Bedrock AgentCore Runtime.

AgentCore runs an agent as an ARM64 container that serves its HTTP protocol contract on port 8080: POST /invocations with a JSON body, answered with JSON or server-sent events, and GET /ping. Each runtime session (the X-Amzn-Bedrock-AgentCore-Runtime-Session-Id header) is one conversation. AgentCoreApp serves that contract for a Rig agent:

  • the session’s conversation is kept between invocations, in memory or in any rig_memory store (see AgentCoreApp::history_store);
  • the reply streams as server-sent events when the caller asks for text/event-stream, and is one JSON object otherwise;
  • each invocation runs in a span that continues the caller’s trace and carries the session as session.id (through rig_otel), which is what AgentCore Observability and Evaluations group a session’s traces by.
rig_agentcore::AgentCoreApp::new(agent).serve().await

Re-exports§

pub use rig_memory;

Structs§

AgentCoreApp
A Rig agent served on AgentCore Runtime’s HTTP protocol contract.

Enums§

ServeError
Why the app stopped serving.

Constants§

DEFAULT_HISTORY_TOKENS
How many tokens of history a session keeps by default.
DEFAULT_MAX_SESSIONS
How many sessions an app keeps by default. AgentCore gives each session its own microVM, so one process usually sees one; this bounds the memory when the app runs elsewhere.
DEFAULT_PORT
The port AgentCore Runtime sends the HTTP protocol to.
SESSION_HEADER
The header AgentCore Runtime names the session with.