Agents
How agents are implemented in the beeai platform, their types and schemas
Agent in the beeai platform is a stateless function that receives and input object that adheres to an input schema and returns an object compliant with the output schema. Optionally, agent can stream progress notifications during its execution. Agents are registered using the Agent Communication Protocol SDK.
Agent logic can be implemented using any framework of choice, for example:
Agent schema
Each agent in the platform has an input and output schema (formal specification of communication with the agent).
To achieve basic compatibility with the platform, the schema must extend the base in the beeai-sdk
package:
The config
input field allows passing extra configuration at runtime, for example a list of tools the agent
should work with.
The logs
can be used to stream progress (thoughts, action items, etc.) that are not part of the actual output, but
are useful to inform the user about what is happening.
Streaming
The agent can use the ctx
object to stream intermediate steps during the agent run. The progress schema must be
a subset of the output schema, the most useful field is logs
. For example reporting events from langgraph:
Standardized agent interfaces
Agents are free to use any input/output schema they like by extending the base Input
and Output
schemas.
However, if the author chooses to opt in into one of the standardized schemas, the agent will get a UI experience out
of the box.
Chat agents
Agents that implement the chat
interface must declare this in their metadata during agent registration and use the
MessageInput
and MessageOutput
schemas.
Chat agents are stateless and receive the entire conversation history on input. This means that any state that the agent is keeping must be re-created on each invocation, for example by setting agentβs memory.
You can then use the agent interactively using the CLI:
Or you can chat with the agent in the browser at:
http://localhost:8333/agents/chat-example
Hands-off agent
Similarly, you can define an agent that will use the TextInput
and TextOutput
and declare the type as
UiType.hands_off
. This agent is for single-prompt tasks that the user will hand off and come back for results.