Overview
TherootAgent is the main LLM agent in the ADK Utils Example project. It demonstrates integration with the Google ADK framework and showcases the use of OllamaModel from the @yagolopez/adk-utils package.
Key Features
- Multi-model support (Gemini, Ollama)
- Three powerful function tools
- Flexible model configuration
- Real-time interaction capabilities
Agent Configuration
The rootAgent is configured with the following properties:Agent identifier:
"agent1"The LLM model to use. Currently configured to use
gpt-oss:120b-cloud via Ollama’s cloud endpoint.Agent description: “Agent with three function tools: get_current_time, create_mermaid_diagram and view_source_code. It retrieves the current time, creates mermaid diagrams and visualizes source code.”
System instructions that guide the agent’s behavior and tool usage.
Array of three function tools:
getCurrentTime, createMermaidDiagram, and viewSourceCode.Complete Implementation
Here’s the full agent definition fromagent1.ts:
OllamaModel Integration
The agent usesOllamaModel from @yagolopez/adk-utils to connect to various Ollama-compatible endpoints:
Available Model Options
The source code includes several commented model options:Modifying the Agent
Changing the Model
To switch between different models, simply uncomment the desired model configuration:Adding New Tools
To add a new tool to the agent:- Create the tool using
FunctionTool:
- Add to the tools array:
- Update the instruction to guide the agent on when to use the new tool:
Customizing Instructions
Theinstruction field is crucial for guiding agent behavior. It should:
- Clearly define the agent’s role
- Specify when to use each tool
- Provide context for decision-making
- Use clear, directive language
Agent Location
Source:~/workspace/source/app/agents/agent1.ts
Next Steps
Tools Reference
Learn about the three function tools available to the agent
OllamaModel
Explore the OllamaModel utility for connecting to Ollama endpoints