| Crates.io | talk |
| lib.rs | talk |
| version | 0.1.1 |
| created_at | 2025-10-12 06:50:02.263016+00 |
| updated_at | 2025-10-12 06:54:34.239245+00 |
| description | A Rust library for creating controlled LLM agents with behavioral guidelines, tool integration, and multi-step conversation journeys |
| homepage | https://github.com/gobenpark/talk |
| repository | https://github.com/gobenpark/talk |
| max_upload_size | |
| id | 1879005 |
| size | 477,875 |
A Rust library for creating controlled LLM agents with behavioral guidelines, tool integration, and multi-step conversation journeys.
Talk enables developers to create production-ready AI agents with predictable behavior in under 50 lines of Rust code, featuring pluggable LLM providers (OpenAI, Anthropic), configurable session storage backends, and comprehensive explainability features.
Add to your Cargo.toml:
[dependencies]
talk = "0.1"
tokio = { version = "1", features = ["full"] }
use talk::{Agent, Guideline, GuidelineCondition, GuidelineAction, OpenAiProvider};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create LLM provider
let provider = OpenAiProvider::new(std::env::var("OPENAI_API_KEY")?);
// Create agent
let mut agent = Agent::builder()
.name("Customer Support")
.provider(provider)
.build()?;
// Define behavioral guideline
let pricing_guideline = Guideline {
condition: GuidelineCondition::Literal("pricing".to_string()),
action: GuidelineAction {
response_template: "Our pricing starts at $49/month for the basic plan.".to_string(),
requires_llm: false,
parameters: vec![],
},
priority: 10,
..Default::default()
};
// Register guideline and process message
agent.add_guideline(pricing_guideline).await?;
let session_id = agent.create_session().await?;
let response = agent.process_message(session_id, "What is your pricing?".to_string()).await?;
println!("Agent: {}", response.message);
Ok(())
}
cargo add talk tokio --features tokio/full
# Redis storage
cargo add talk --features redis-storage
# PostgreSQL storage
cargo add talk --features postgres-storage
# All storage backends
cargo add talk --features all-storage
See the examples/ directory for more complex use cases:
simple_agent.rs - Basic agent with guidelinesweather_agent.rs - Agent with tool integrationonboarding.rs - Multi-step journey exampleTalk is built on:
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Licensed under either of:
at your option.
Inspired by Parlant, the Python library for creating LLM-based agents.
Ready to build production-ready AI agents in Rust! π¦