| Crates.io | kowalski-agent-template |
| lib.rs | kowalski-agent-template |
| version | 0.5.0 |
| created_at | 2025-06-28 21:14:06.008766+00 |
| updated_at | 2025-06-28 21:14:06.008766+00 |
| description | Kowalski Template of Agent: A Rust-based agent for interacting with Ollama models |
| homepage | https://github.com/yarenty/kowalski |
| repository | https://github.com/yarenty/kowalski |
| max_upload_size | |
| id | 1730131 |
| size | 114,432 |
A flexible foundation for building custom AI agents in the Kowalski ecosystem. This crate provides a robust agent base, builder patterns, configuration, and ready-to-use templates for rapid agent development.
kowalski-agent-template is designed to make it easy to create new, specialized AI agents by composing tools, task handlers, and configuration. It provides a TemplateAgent abstraction, a builder for ergonomic construction, and a set of templates (such as general-purpose and research agents) to jumpstart development.
kowalski-agent-template/
├── src/
│ ├── agent.rs # TemplateAgent and TaskHandler traits
│ ├── builder.rs # AgentBuilder for ergonomic agent construction
│ ├── config.rs # TemplateAgentConfig and defaults
│ ├── lib.rs # Library entry point
│ └── templates/ # Predefined agent templates
│ ├── general.rs # General-purpose agent template
│ ├── research.rs # Research-focused agent template
│ └── mod.rs
The TemplateAgent struct provides a flexible base for building custom agents. It supports:
use kowalski_agent_template::agent::TemplateAgent;
use kowalski_core::tools::{Tool, ToolInput, ToolOutput};
use kowalski_core::config::Config;
let config = Config::default();
let agent = TemplateAgent::new(config).await?;
// Register tools and handlers as needed
The AgentBuilder pattern allows you to fluently compose an agent with custom tools, prompts, and settings.
use kowalski_agent_template::builder::AgentBuilder;
use kowalski_tools::web::WebSearchTool;
let builder = AgentBuilder::new()
.await
.with_system_prompt("You are a helpful assistant.")
.with_tool(WebSearchTool::new("duckduckgo".to_string()))
.with_temperature(0.5);
let agent = builder.build().await?;
The TemplateAgentConfig struct provides flexible configuration for agent behavior, including concurrency, timeouts, user agent, and system prompt.
use kowalski_agent_template::config::TemplateAgentConfig;
let config = TemplateAgentConfig::default();
println!("System prompt: {}", config.system_prompt);
A general-purpose agent with basic tools (web search, PDF processing) and customizable prompt/temperature.
use kowalski_agent_template::templates::general::GeneralTemplate;
let builder = GeneralTemplate::create_default_agent().await?;
let agent = builder.build().await?;
You can also create a custom general agent:
let builder = GeneralTemplate::create_agent(
vec![Box::new(WebSearchTool::new("duckduckgo".to_string()))],
Some("You are a specialized assistant for web research.".to_string()),
Some(0.5)
).await?;
let agent = builder.build().await?;
A research-focused agent with web search and PDF analysis tools, and a research-oriented system prompt.
use kowalski_agent_template::templates::research::ResearchTemplate;
let builder = ResearchTemplate::create_agent().await?;
let agent = builder.build().await?;
Tool trait and register with your agent or builder.TaskHandler trait for custom logic.templates/ directory.TemplateAgentConfig for new settings.