| Crates.io | kowalski-web-agent |
| lib.rs | kowalski-web-agent |
| version | 0.5.0 |
| created_at | 2025-06-28 21:47:31.754224+00 |
| updated_at | 2025-06-28 21:47:31.754224+00 |
| description | Kowalski Web 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 | 1730148 |
| size | 145,509 |
Initial Proof of Concept Agent
A specialized AI agent for web research and online information retrieval, built on the Kowalski framework. The Web Agent provides intelligent, conversational access to web search and web scraping, enabling users to find, summarize, and analyze online content.
The Web Agent is an AI-powered assistant that combines large language models with web search and scraping tools. It helps users discover, extract, and summarize information from the internet, supporting research, fact-checking, and content synthesis.
The Web Agent implements a ReAct (Reasoning and Acting) loop that enables intelligent tool usage:
The agent can intelligently chain tools:
// The agent will automatically:
// 1. Use web_search to find relevant URLs
// 2. Use web_scrape to extract content from promising URLs
// 3. Synthesize the information into a comprehensive answer
let response = agent.chat_with_tools(&conv_id, "What are the latest developments in AI?").await?;
use kowalski_web_agent::WebAgent;
use kowalski_core::config::Config;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::default();
let mut web_agent = WebAgent::new(config).await?;
// Perform a web search
let results = web_agent.search("AI").await?;
for result in &results {
println!("Title: {}", result.title);
println!("URL: {}", result.url);
println!("Snippet: {}", result.snippet);
}
// Fetch and summarize a web page
if let Some(first) = results.first() {
let page = web_agent.fetch_page(&first.url).await?;
println!("Page Title: {}", page.title);
println!("Content: {}", &page.content[..100]);
}
Ok(())
}
use kowalski_web_agent::WebAgent;
use kowalski_core::config::Config;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::default();
let mut agent = WebAgent::new(config).await?;
// Start a conversation
let conv_id = agent.start_conversation("llama3.2");
// Use ReAct-style tool calling for complex queries
let response = agent.chat_with_tools(&conv_id, "What's the latest news about AI?").await?;
println!("Response: {}", response);
// The agent will automatically:
// 1. Search for recent AI news
// 2. Scrape relevant articles
// 3. Synthesize the information
// 4. Provide a comprehensive answer
Ok(())
}
The example successfully:
Running the web research example:
🤖 Starting web agent...
Web Agent Conversation ID: 12345678-90ab-cdef-1234-567890abcdef
🔍 Searching: AI
📑 Result:
Title: Artificial Intelligence - Wikipedia
URL: https://en.wikipedia.org/wiki/Artificial_intelligence
Snippet: Artificial intelligence (AI) is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans and animals...
📑 Result:
Title: What is AI? | IBM
URL: https://www.ibm.com/topics/artificial-intelligence
Snippet: Artificial intelligence leverages computers and machines to mimic the problem-solving and decision-making capabilities of the human mind...
🌐 Processing first result: https://en.wikipedia.org/wiki/Artificial_intelligence
📝 Generating summary...
Artificial intelligence (AI) is when computers or machines are designed to think and learn like humans. It helps solve problems, make decisions, and can be found in things like voice assistants or self-driving cars.
✅ Summary complete!
Running the tool-calling demo:
Kowalski Web Agent Tool-Calling Demo
=====================================
Conversation started with ID: abc123
--- Query: What's the latest news about AI? ---
Processing with ReAct-style tool calling...
[DEBUG] Iteration 1: What's the latest news about AI?
[DEBUG] Tool call detected: web_search with input: latest AI news 2024
[DEBUG] Tool web_search executed successfully: [search results...]
[DEBUG] Iteration 2: Based on the tool result: [search results...]
[DEBUG] Tool call detected: web_scrape with input: https://example-news-site.com
[DEBUG] Tool web_scrape executed successfully: [article content...]
Final Response: Based on recent news, AI developments include...
--- End Query ---
Note: This is an initial proof of concept agent. Features, reliability, and coverage will expand in future versions.