What Is a Galadriel Agent?
It’s an entire AI system that includes:- Agent Interface (e.g.,
ToolCallingAgent
,CodeAgent
, or a custom interface you build), - Tools it can call (e.g., a web search tool, a database query tool),
- Memory for context,
- Input/Output Clients that send user queries and receive responses,
- A Runtime that orchestrates continuous execution, communication and state persistence.

What is autonomy?
Autonomy refers to how many decisions the Agent makes on its own to complete a task. This can range from simply choosing one of two routes (low autonomy) to a full multi-step, looped approach (high autonomy):Agency Level | Description | Example Pattern |
---|---|---|
★☆☆ (Low) | LLM output is used for simple decisions (like routing). | if llm_decision(): path_a() else: path_b() |
★★☆ (Medium) | LLM decides which tool/function to call and its arguments. | tool_name, args = llm_parse_output(); tool_name(args) |
★★★ (High) | LLM controls the entire multi-step loop and orchestrates calls. | while llm_should_continue(): execute_next_step() |
Tools, Loops, and Runtime
- Tools provide real-world capabilities (e.g., searching the web, querying databases, etc.).
- Loops enable iterative reasoning, via a ReAct-style approach:
- Observe the current situation,
- Think (“Thought”),
- Call a tool if needed (“Action”),
- Observe the result (“Observation”),
- Decide if another step is needed.
- The Runtime connects all the dots by continuously feeding user requests to the Agent, capturing outputs, and optionally handling concurrency, logging, or multi-agent orchestration.
The Agent Interface
The Agent Interface is composed of the following interface: a class with anexecute
method that takes in a Message
and returns a Message
:
Message
is defined as:
Note: This is the bare-bones of an Agent Interface. However, when we refer to Agents, we mean the entire system which also includes tools, memory, runtime and clients.
Built-In Agent Interfaces
Galadriel provides two main interfaces you can use out of the box:ToolCallingAgent
– Focuses on calling external functions (tools) to solve tasks.CodeAgent
– Lets the LLM “write” Python code that is then executed, offering a powerful and flexible approach for certain use-cases.
CharacterAgent
shows how to craft an agent with a distinct persona (like a Discord bot with a particular style).
Sample Usage
Below is a quick demonstration of how to set up aCodeAgent
with a web search tool, run it via the runtime, and communicate with a simple input/output client.
CodeAgent
can “write” code to perform tasks.DuckDuckGoSearchTool
provides a web search capability.SimpleMessageClient
supplies the user’s query and will receive the final answer.AgentRuntime
ties it all together, feeding data between the user, agent, and output.
Multi-Agents
Multi-agent systems enable several agents to work together on a task, often yielding better performance than a single monolithic agent. By dividing responsibilities among agents, you can achieve efficient specialization. For example, rather than filling the memory of a code-generating agent with the details of every webpage visited by a web search agent, you can separate these concerns by delegating tasks to specialized agents.Key Concepts
- Specialization: Each agent focuses on a specific sub-task, leveraging unique tool sets and memory.
- Delegation: A manager agent can direct tasks to worker agents optimized for those tasks.
Implementation Example
- Manager Agent: A CodeAgent that receives user queries and coordinates with specialized worker agents.
- Web Search Agent: A worker agent equipped with DuckDuckGoSearchTool to handle web search requests.
- SimpleMessageClient: Implements input/output interfaces to send queries and display results.
- AgentRuntime: Connects the manager and worker agents with the client, orchestrating continuous execution.
Conclusion
Agents in Galadriel empower you to build autonomous AI systems that:- Utilize state-of-the-art LLM Models.
- Integrate seamlessly with Tools.
- Maintain meaningful Memory.
- Run continuously, responding to user requests in real time when combined with an AgentRuntime.
Next Steps
- Learn how to integrate your agent into the AgentRuntime.
- Examples - Check out our repository for real-world sample projects.