# Agentry – AI Agents as React Components

Hi HN, 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…

- **Page:** https://magpie.gallery/i/agentry-ai-agents-as-react-components-m1n1
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** agents, react, framework, components, hooks

## Source

Web · colinds: Agentry – AI Agents as React Components

- **Original:** https://news.ycombinator.com/item?id=46208104

> Hi HN, 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... https://github.com/colinds/agentry

## GitHub projects

- https://github.com/colinds/agentry

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
