Inspiration
Every AI framework promises to make building intelligent applications easier. In reality, once you move beyond a simple chatbot, the developer experience quickly becomes fragmented.
As a freelance AI engineer, I repeatedly found myself rebuilding the same infrastructure for every client. One framework handled agents well but had no clean way to connect to modern React or Next.js applications. Another supported multiple models but became difficult to self-host. Streaming responses required custom implementations, state synchronization was inconsistent, and integrating external tools often meant writing large amounts of glue code. Even switching from one LLM provider to another usually meant changing application code.
I realized I wasn't spending most of my time building AI products - I was rebuilding AI infrastructure.
That frustration became the motivation behind agui-framework.
Rather than creating another opinionated agent framework, I wanted to build a developer toolkit that removed infrastructure headaches entirely. My goal was simple: let developers focus on building intelligent applications while the framework handles communication, orchestration, streaming, memory, state management, and deployment.
The framework was designed around one philosophy:
Building AI applications should feel like building any modern full-stack application.
What it does
agui-framework is a production-ready TypeScript SDK for building AI agent-powered applications.
It provides everything needed to build intelligent applications from a single SDK:
- AI agents with streaming and resumable execution
- Support for OpenAI, Anthropic, Ollama, and Fireworks through one unified interface
- Built-in shared state for collaborative and multi-agent systems
- Long-term semantic memory powered by RDF and Oxigraph
- Native support for the AG-UI protocol for real-time frontend communication
- MCP (Model Context Protocol) integration for connecting external tools
- React hooks for streaming responses and synchronizing application state
- REST, SSE, WebSocket, Redis, and PostgreSQL support out of the box
- Automatic usage tracking and cost calculation across providers
Instead of spending days wiring together multiple libraries, developers can install one SDK and immediately begin building production-ready AI applications.
How we built it
We built agui-framework entirely in TypeScript with a strong emphasis on composability and developer experience.
Instead of tightly coupling the framework to a specific provider, every component was designed around interchangeable interfaces. LLM providers, memory systems, thread stores, communication protocols, and middleware can all be swapped without changing application logic.
Everything inside the framework revolves around an event-driven architecture. Every conversation, tool call, state update, and streamed response is represented as structured events. Those events can be observed, transformed, persisted, or streamed directly to any frontend using the AG-UI protocol.
One of the biggest architectural decisions was treating frontend communication as a first-class concern rather than an afterthought. The same events generated internally by an agent can be streamed directly to React, Next.js, or any other client without translation layers.
Throughout development, Codex acted as an AI pair programmer, helping accelerate implementation, testing, and documentation while every architectural decision and implementation remained intentionally designed and validated through iterative development.
Challenges we ran into
The hardest challenge wasn't building agents, it was making every provider behave consistently.
Every LLM exposes streaming, tool calls, structured outputs, and function execution differently. Creating a unified developer experience while preserving provider-specific capabilities required extensive testing and many iterations of the abstraction layer.
Long-term memory introduced another interesting challenge. We wanted semantic memory rather than simple vector storage, which led us to RDF and Oxigraph. Supporting asynchronous initialization while keeping the API simple required redesigning the memory lifecycle several times.
Supporting both self-hosted deployments and modern JavaScript frameworks also meant solving compatibility issues across ESM, CommonJS, WebSockets, server-side rendering, and multiple runtime environments.
Each challenge pushed the framework toward becoming more modular, more predictable, and easier for developers to adopt.
Accomplishments that we're proud of
What started as a personal solution has grown into a complete AI application framework.
We're particularly proud that developers can now:
- Build once and switch between multiple LLM providers without rewriting application logic.
- Create real-time AI applications with streaming built into the framework.
- Deploy entirely on their own infrastructure without relying on proprietary cloud services.
- Build collaborative multi-agent systems using shared state and event-driven workflows.
- Connect any MCP-compatible tool server with only a few lines of configuration.
- Monitor token usage and application costs automatically across providers.
The framework now includes comprehensive automated testing across hundreds of test cases, giving developers confidence that applications behave consistently across supported providers.
What we learned
Building AI infrastructure taught us that the hardest part of AI development isn't prompting models, it's connecting everything around them.
Reliable streaming, shared state, frontend synchronization, persistence, external tools, and deployment all become part of the developer experience.
We also learned that flexibility matters more than abstraction. Developers want the freedom to choose providers, databases, hosting environments, and frontend frameworks without being locked into a single ecosystem.
Finally, we learned that AI-assisted development works best when paired with strong engineering practices. Codex dramatically accelerated implementation, but rigorous testing, architectural planning, and iterative refinement remained essential to building a reliable framework.
What's next for agui-framework
This is only the beginning.
Our roadmap focuses on making AI applications even more collaborative and dynamic:
- Intelligent multi-agent routing based on capabilities and conversation context.
- Generative user interfaces that agents can create dynamically.
- Rich metadata events for analytics, moderation, and user feedback.
- REST APIs for semantic long-term memory.
- Agent-to-agent communication through MCP.
- Real-time state synchronization across connected clients.
- A plugin ecosystem that allows developers to share agents, tools, middleware, and UI components as reusable packages.
Our vision is to become the infrastructure layer developers reach for when building modern AI-native applications - whether they're creating personal assistants, autonomous workflows, collaborative agent systems, or entirely new categories of software.
Built With
- agents
- ai
- nextjs
- openai
- typescript
Log in or sign up for Devpost to join the conversation.