A new Agentuity project created with agentuity create.
A fully configured Agentuity project with:
- ✅ TypeScript - Full type safety out of the box
- ✅ Bun runtime - Fast JavaScript runtime and package manager
- ✅ Hot reload - Development server with auto-rebuild
- ✅ Example agent - Sample "hello" agent to get started
- ✅ React frontend - Pre-configured web interface
- ✅ API routes - Example API endpoints
- ✅ Type checking - TypeScript configuration ready to go
my-app/
├── src/
│ ├── agent/ # Agent definitions
│ │ └── hello/
│ │ ├── agent.ts # Example agent
│ │ └── index.ts # Default exports
│ ├── api/ # API definitions
│ │ └── index.ts # Example routes
│ └── web/ # React web application
│ ├── public/ # Static assets
│ ├── App.tsx # Main React component
│ ├── frontend.tsx # Entry point
│ └── index.html # HTML template
├── AGENTS.md # Agent guidelines
├── app.ts # Application entry point
├── tsconfig.json # TypeScript configuration
├── package.json # Dependencies and scripts
└── README.md # Project documentation
After creating your project, you can run:
bun devStarts the development server at http://localhost:3500
bun buildCompiles your application into the .agentuity/ directory
bun typecheckRuns TypeScript type checking
bun run deployDeploys your application to the Agentuity cloud
After creating your project:
- Customize the example agent - Edit
src/agent/hello/agent.ts - Add new agents - Create new folders in
src/agent/ - Add new APIs - Create new folders in
src/api/ - Add Web files - Create new routes in
src/web/ - Customize the UI - Edit
src/web/app.tsx - Configure your app - Modify
app.tsto add middleware, configure services, etc.
Create a new agent by adding a folder in src/agent/:
// src/agent/my-agent/agent.ts
import { createAgent } from '@agentuity/runtime';
import { s } from '@agentuity/schema';
const agent = createAgent({
description: 'My amazing agent',
schema: {
input: s.object({
name: s.string(),
}),
output: s.string(),
},
handler: async (_ctx, { name }) => {
return `Hello, ${name}! This is my custom agent.`;
},
});
export default agent;Create custom routes in src/api/:
// src/api/my-agent/route.ts
import { createRouter } from '@agentuity/runtime';
import myAgent from './agent';
const router = createRouter();
router.get('/', async (c) => {
const result = await myAgent.run({ message: 'Hello!' });
return c.json(result);
});
router.post('/', myAgent.validator(), async (c) => {
const data = c.req.valid('json');
const result = await myAgent.run(data);
return c.json(result);
});
export default router;- Bun v1.0 or higher
- TypeScript 5+