effect-uai
Effectful building blocks for agentic ai
Agents should be ordinary programs: explicit state, typed effects, visible streams, and tools you control. effect-uai gives you the primitives to build that loop without handing your architecture to a framework.
8 capabilities 14 providers 32+ recipes MIT license
Build agents that do more than chat
Your agent can speak, listen, remember, search the web, and run code. Each capability is one small interface, the same whichever provider you pick.
Language models
Build streaming, tool-calling agents over OpenAI, Anthropic, Gemini, and Mistral.
Explore
Speech
Transcribe audio and synthesize speech, batch or live, for voice agents.
Explore
Embeddings
Vectorize text for semantic search, RAG, and clustering.
Explore
Music generation
Generate music from prompts, one-shot or streaming.
Explore
Web search
Ground answers in live web results, with citations.
Explore
Web reading
Turn any URL into clean markdown, then extract typed data from it.
Explore
Sandboxes
Run model-written code in isolated microVMs.
Explore
Browser
Drive a real browser: navigate, click, fill, and read pages as markdown.
Explore
And more coming soon.
13 providers. Swap anytime.
Write against a shared interface and switch providers without touching your agent code.
Features
Explicit control
No black-box magic. You stay in full control of your agent loop.
Built on Effect
Retries, streams, concurrency, errors: handled by Effect, not reinvented.
Powerful building blocks
Small, composable primitives to assemble your own agentic loops.
Recipes for the hard parts
Copy-paste solutions for common agentic use cases that you can adapt as needed.
Streaming first
Everything is a stream you can transform, filter, and collect when ready. Performance built in.
Typed errors
Easy and type-safe error handling. Match
RateLimited, Unavailable, or Timeout directly, no string parsing.Carry your own state
History, budget, scratchpad: track whatever your agent needs. It's just a value.
Provider-portable
Code against the generic tag. Swap OpenAI, Anthropic, Gemini, or Mistral by changing a Layer.
Platform-independent
Built on Effect's platform layer, so the same agent code runs on Bun, Node, and Deno.
Recipes
32 and countingEach recipe shows how to solve a common agent problem with the primitives.
Tool call approval
Pause on sensitive tools. HTTP-bundled or queue-driven verdicts; same primitive.
Read recipeTools & HITL
Live tool updates
Watch tools work. Stream progress and reasoning as they run; the model gets one clean result.
Read recipeTools & HITL
Stream typed objects
Stream data as it arrives. Decode and validate one object at a time as the model writes.
Read recipeTools & HITL
Multi-model fallback
Stay online when a provider fails. Switch automatically on rate limits or outages.
Read recipeReliability
Model escalation
Pay only when needed. The cheap model handles easy questions and escalates hard ones to a more capable model.
Read recipeMulti-model
Auto-compaction
Never run out of context. Summarize history before the token budget runs dry.
Read recipeReliability
Pause and resume
Pause without losing progress. Hold the loop between turns and continue right where it stopped.
Read recipeReliability
Mid-stream abort
Stop on a dime. Cancel a running turn, drop the HTTP connection, and keep the partial output.
Read recipeReliability
Sleeper agent
Wait for a long-running tool call. The agent goes quiet while the work runs and wakes up the moment it's done.
Read recipeReliability
Agentic loop
Stay online for the whole chat. Pull user messages from a queue; debounce bursts into one batch.
Read recipeReliability
Modify output stream
Format for the wire. Map one function to ship the loop's output as SSE or JSONL.
Read recipeTransport
Model retry
Retry transient failures. Exponential backoff for rate limits and timeouts; fail fast on the rest.
Read recipeReliability
Multi-model compare
See how models differ. Send one prompt to OpenAI, Google, and Anthropic at once.
Read recipeMulti-model
Model council
Get the best answer. Models judge each other, the winner streams back.
Read recipeMulti-model
Voice loop
Talk to your agent. Streaming STT, LLM, and TTS composed as Effect fibers; stop-words interrupt mid-sentence.
Read recipeSpeech
Radio station
Run your own AI radio station. An AI DJ writes the next track while you listen to the current one; the same set replays for free.
Read recipeMusic
Run, fix, repeat
Let the model run its own code. It writes Python; the sandbox runs it; tracebacks feed back into the next turn until the answer's right.
Read recipeSandboxes
Grounded answer
Answer from the live web. The model searches, reads the results, and writes a cited answer; swap the LLM and search backend independently.
Read recipeWeb search
Deep research
Research a broad question. Plan it into sub-questions, investigate each with a streaming sub-agent, and synthesize one cited report.
Read recipeWeb search
Market intel
Extract typed data from any page. Read a batch of vendor pages and pull a structured pricing record from each, no selectors, concurrently.
Read recipeWeb reading
Agent usability testing
Test your UX with an agent. Give it a goal and a URL; it drives a real browser and reports whether it got there and where it hit friction.
Read recipeBrowser
Dashboard briefing
Read dashboards like a human. Screenshot a client-rendered dashboard and get a typed briefing: trend, anomalies, headline numbers.
Read recipeBrowser
Ready to build your loop?
Install the package, copy a recipe, keep your loop explicit.