Back to browse
GitHub Repository

A small, typed, hookable agent loop. Provider-agnostic, sandbox-agnostic, tooling-agnostic. Battle tested on clarkchat.com

9 starsRust

Clark-agent, a Rust library for LLM tool loops

by stan_kirdey·May 26, 2026·1 point·0 comments

AI Analysis

●●SolidShip ItNiche Gem

Typed, hookable agent loop in Rust when LangChain dominates Python.

Strengths
  • Plugin extension points (BeforeToolCall, AfterToolCall, ContextTransform) are well-designed.
  • Provider-agnostic StreamFn trait allows swapping LLM transports easily.
  • Battle-tested on clarkchat.com, not just theoretical architecture.
Weaknesses
  • Agent framework space is crowded — LangChain, AutoGen, LlamaIndex already exist.
  • Rust agent tooling is niche; Python ecosystem has far more adoption.
Category
Target Audience

Rust developers building LLM agent applications

Similar To

LangChain · AutoGen · LlamaIndex

Post Description

Hi HN,

I wrote clark-agent, a small Rust library for running LLM tool loops.

The loop is:

context -> model -> tool call -> tool result -> repeat

The parts I wanted typed were:

- transcript messages - tool calls - tool results - stream events - tool schemas

The model/provider boundary is a StreamFn trait. Tools implement AgentTool. There are hooks for things like context transforms, tool gates, observers, and follow-up messages.

Similar Projects

AI/ML●●Solid

Open Agent Spec. Treat AI agents like typed functions not prompt chains

Schema validation catches LLM output mismatches before they break downstream systems.

Big BrainNiche Gem
andrewvector
212mo ago