WeSearch

Show HN: Clark-agent, a Rust library for LLM tool loops

·3 min read · 0 reactions · 0 comments · 13 views
#rust#programming#library
Show HN: Clark-agent, a Rust library for LLM tool loops
⚡ TL;DR · AI summary

Clark-agent is a Rust library designed for creating typed, hookable agent loops that are provider-agnostic. It allows for flexible tool integration and execution management while maintaining strong typing and structured event handling. The library supports various configurations and plugins to extend its functionality and streamline interactions with language models.

Key facts
Original article
GitHub
Read full at GitHub →
Opening excerpt (first ~120 words) tap to expand

clark-agent A small, typed, hookable agent loop. Provider-agnostic, sandbox-agnostic, tooling-agnostic. Shape context → LLM (StreamFn) → tool batch → results appended → repeat Termination is a tool decision (ToolResult::terminate = true, unanimous across the batch). The runtime owns execution and event emission; tools own semantics; plugins own cross-cutting extension. Layers types — AgentMessage, content blocks, StopReason. Conversation is Vec<AgentMessage>. Apps extend via AgentMessage::Custom or by wrapping in their own enum. event — AgentEvent enum + EventSink trait. Single sink, typed events. Streamed and final delivery use the same enum. ChannelSink, FanOutSink, NoopSink provided. tool — AgentTool trait + ToolRegistry. Tools own their schema, validation, and execution.

Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from GitHub