Package akka.javasdk.agent
package akka.javasdk.agent
Agent components, plus the guardrails and classifiers that govern
their model and tool calls.-
ClassDescriptionAn AI agent component that interacts with an AI model, such as a large language model (LLM), to perform specific tasks.A detailed reply from an agent component call, containing both the result and additional information, like token usage.Agent.Effect<T>An Effect is a description of what the runtime needs to do after the command is handled.Construct the effect that is returned by the message handler.Agent.Effect.FailureBuilder<Result>A StreamEffect is a description of what the runtime needs to do after the command is handled, for a message handler that streams the model's response token by token instead of returning it as a single reply.Construct the effect for token streaming that is returned by the message handler.The number of tokens consumed by a model interaction.Context information available to an agent during command handling.Marker interface implemented by agent types that can act as delegation workers.The registry contains information about all agents.A guardrail that decides whether the agent's final reply may be returned.Per-call context passed to an
AgentResponseGuardrailduringAgentResponseGuardrail.decide(akka.javasdk.agent.AgentResponseGuardrail.CallContext).The result of aClassifier: a score and/or label, with optional confidence and attributes.A classifier maps an input to aClassification— a score and/or label, with optional confidence and metadata.Client for invoking a configuredClassifierby name.Context information available to a classifier constructor.Interface for loading content from URIs.Represents loaded content with its binary data and MIME type.The verdict of aToolCallGuardrail,ModelCallGuardrailorAgentResponseGuardrail:Decision.Allow,Decision.Deny, orDecision.Fail.The guardrail saw nothing wrong with the call.The guardrail decided the call must not proceed.The guardrail could not reach a verdict because the check itself failed.When anAgentreturns anEvaluationResultit is tracked in metrics and traces.Guardrails can protect against harmful inputs and outputs to/from model and tool calls.Thrown whenreport-onlyis false and a guardrail denies the call or fails.A message in the conversation a guardrail inspects, carrying its origin: what the user said, what the model replied (and which tools it requested), and what a tool returned.A model reply, with only its text and the tool calls it requested.A tool call the model requested: its id, tool name, and raw arguments.The result a tool returned for a requested tool call.A user-authored message.Deprecated, for removal: This API element is subject to removal in a future version.Context information available to a guardrail constructor.Deprecated, for removal: This API element is subject to removal in a future version.useContentLoaderRepresents a loaded image with its binary data and MIME type.Exception thrown when there is an internal failure within the agent system.Exception thrown when there is an error parsing JSON responses from the model.Exception thrown when an MCP (Model Context Protocol) tool call fails during execution.Filters for controlling which messages are included when retrieving session history from memory.Filter that excludes messages from agents with the specified component IDs or roles.Filter that includes messages from agents with the specified component IDs or roles.A fluent builder for composing multiple memory filters.Interface for configuring memory management in agent systems.Memory provider that uses a custom SessionMemory implementation.Disabled memory provider, which does not store or retrieve contextual history.Configuration-based memory provider that reads settings from the specified path.Memory provider that wraps anotherMemoryProviderwith aSessionMemoryInterceptor.Memory provider that limits session history based on size or message count.Represents a piece of content within a multimodal message to an AI model.Inline content already loaded as bytes.Image content carried as inline bytes, for returning binary media from a@FunctionTool.Image content carried as inline bytes.Factory methods for creating image message content.Controls the level of detail used when processing images.Image content within a user message, referenced by URI.PDF content carried as inline bytes, for returning binary media from a@FunctionTool.PDF content carried as inline bytes.Factory methods for creating PDF message content.PDF content within a user message, referenced by URI.Text content within a user message.A guardrail that decides whether a model call may proceed.Per-call context passed to aModelCallGuardrailduringModelCallGuardrail.decide(akka.javasdk.agent.ModelCallGuardrail.CallContext).Built-inModelCallGuardrail.Exception thrown when there is a failure with the AI model.Configuration interface for AI model providers used by agents.Settings for the Anthropic Large Language Model provider.Settings for the Azure OpenAI Large Language Model provider.Placement of the prompt cache point when using Bedrock with supported Claude or Nova models.Custom models can be added by implementing this interface and, and the underlying implementations ofdev.langchain4j.model.chat.ChatModeland (optionally)dev.langchain4j.model.chat.StreamingChatModel.A model provider selected by configuration, resolved when the agent makes the request.Settings for the Google AI Gemini Large Language Model provider.Settings for the Local AI Large Language Model provider.Settings for the Mistral AI Large Language Model provider.Settings for the Ollama Large Language Model provider.Settings for the OpenAI Large Language Model provider.Settings for the Google Cloud Vertex AI Large Language Model provider.Exception thrown when a request to an AI model or external service times out.A built-in Event Sourced Entity for managing dynamic prompt templates with change history.Events persisted by aPromptTemplate.The prompt template was deleted.The prompt template was initialized or updated with new text.The current state of a prompt template: its text, or empty if deleted.Exception thrown when rate limits are exceeded when calling an AI model or external service.Configuration for accessing tools from remote Model Context Protocol (MCP) servers.Context details about the intercepted MCP tool call.The full message history of a session, as loaded fromSessionMemoryEntity.The entity returned the full history within its size limit.The entity could not deliver the full history within its in-memory size limit.Interface for managing contextual session history between users and AI models.Built-in Event Sourced Entity that provides persistent session memory for agent interactions with the AI model.Sealed interface representing events that can occur in the SessionMemory entity.An event that adds a message to the history, as opposed to a lifecycle event.Interceptor for write operations onSessionMemory.Interface for message representation used inside the SessionMemoryEntity state.The model's reply, with any tool calls it requested and the token usage it incurred.Persisted image content, referenced by URI rather than inline bytes.Persisted PDF content, referenced by URI rather than inline bytes.Persisted text content.The multimodal result of a tool call, fed back to the model as input.A multimodal user message, e.g.Token usage for a singleSessionMessage.AiMessage.A tool call requested by the model as part of anSessionMessage.AiMessage.The text result of a tool call, fed back to the model as input.A plain text user message.Deprecated, for removal: This API element is subject to removal in a future version.Using SimilarityGuard formodel-requestormodel-responseis deprecated.Deprecated, for removal: This API element is subject to removal in a future version.Exception thrown when there is a failure executing a tool call.A guardrail that decides whether a tool call may be dispatched.Per-call context passed to aToolCallGuardrailduringToolCallGuardrail.decide(akka.javasdk.agent.ToolCallGuardrail.CallContext).Thrown when the maximum number of tool call steps has been reached.Exception thrown when an unsupported feature is requested from an AI model or service.Represents a user message that can contain multimodal content for interaction with AI models.
DecisionfromToolCallGuardrail,ModelCallGuardrailorAgentResponseGuardrail.