Back to browse
A provider-agnostic agent loop built on ports and adapters

A provider-agnostic agent loop built on ports and adapters

by hopefulbutwary·Jul 2, 2026·3 points·0 comments

Post Description

I work on agent infra at Featherless. This is MIT and works with any OpenAI-compatible endpoint, not just ours. I kept rebuilding the same loop: call model, run tools, feed results back, stop. Every framework I tried either owned the UI, owned the control flow, or dragged a dependency tree. So I pulled the loop out and put every piece behind an interface: memory, model, tools, stop condition. The loop depends only on the interfaces. It never writes to a screen. It emits one typed event stream, so a trace is just data, and you render it however you want. The landing page scrubs one run and rebuilds a CLI, a DOM timeline, and raw JSONL from the same stream. One dependency (zod). Same build runs in Node, Bun, Deno, and a browser tab. Every seam is tested in isolation with deterministic doubles, no network. Why not the Vercel AI SDK, pi, or LangGraph: AI SDK owns more of the surface and has been awkward with self-hosted tool calling. pi is a great coding-agent toolkit but it's shaped around being a coding agent and ships a TUI. LangGraph is a heavier graph framework. This is the layer under all of those: the bare loop you'd build any of them on. Happy to be told where the seams are wrong. If anyone finds any problems let me know this field moves at break neck speed so let me know if I am missing anything.

Similar Projects

AI/ML●●●Banger

Agent-recall-AI – Auto-save for AI agents that die mid-task

Auto-save for AI agents that survives context limits without changing your code.

Solve My ProblemZero to One
SrinathSankara
222mo ago