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.Interface for loading content from URIs.Represents loaded content with its binary data and MIME type.When an
Agentreturns anEvaluationResultit is tracked in metrics and traces.Guardrails can protect against harmful inputs and outputs to/from model and tool calls.Thrown when the text didn't pass the evaluation criteria, andreport-onlyis true.The result of the guardrail evaluation.Context information available to a guardrail constructor.Deprecated, for removal: This API element is subject to removal in a future version.Represents 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.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.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.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.The SimilarityGuard evaluates the text by making a similarity search in a dataset of "bad examples".Guardrails can protect against harmful inputs and outputs to/from model and tool calls.Exception thrown when there is a failure executing a tool call.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.
ContentLoader