Over Thanksgiving weekend I wanted to build an AI agent. As a design exercise, I wrote it as a set of React components. The component model made it easier to reason about the moving parts, composability was straightforward (e.g., reusing agents/tools), and hooks/state felt like a reasonable way to model behavior that changes over time.
As I kept experimenting, I realized I was more interested in the framework (and it was a good excuse to explore React’s internals) than in the agent I originally planned, so I built this project instead.
In this framework:
- Agents are React components.
- Agents have <Message>, <Tools>, … and even other agents as tools via <AgentTool>.
- You can mount/unmount tools based on React state, and tools can set state to change what tools are available on the next turn.
- There is a <Condition when="<natural language>" /> component that allows changing behavior based on the conversation history.
- Built-in support for code execution, web search, memory, and MCP servers through Anthropic’s API.
This is still a WIP project, but I’d love any feedback.
---
Repo: https://github.com/colinds/agentry
Selected examples:
- Hooks: https://github.com/colinds/agentry/blob/main/packages/exampl...
- Subagents: https://github.com/colinds/agentry/blob/main/packages/exampl...
- Conditions: https://github.com/colinds/agentry/blob/main/packages/exampl...