Examples
Complete, runnable examples demonstrating AIDK features.
Quick Links
- Simple Chat - Basic chat agent with streaming
- Task Assistant - Full-stack app with tools and channels
- Multi-Agent - Research coordinator with Component Tools and Fork/Spawn
- Dynamic Router - Model switching based on context
- User Memory - Tools that remember and personalize
- Voting Consensus - Multi-agent voting for reliable outputs
- Progressive Adoption - Start simple, add features incrementally
Running Examples
All examples are in the example/ directory.
bash
# Clone the repo
git clone https://github.com/rlindgren/aidk.git
cd aidk
# Install dependencies
pnpm install
# Run the backend
cd example
pnpm dev:backend
# In another terminal, run the frontend
cd example
pnpm dev:frontendExample Structure
example/
├── backend/ # Express + AIDK server
│ ├── agents/ # Agent definitions
│ ├── tools/ # Tool implementations
│ ├── channels/ # Channel definitions
│ └── server.ts # Express setup
│
├── frontend-react/ # React client
│ └── src/
│ ├── App.tsx
│ └── components/
│
└── frontend-angular/ # Angular client
└── src/app/By Feature
State Management
See how signals work:
- Files:
backend/agents/task-assistant.tsx - Features:
comState,signal,computed
Tools
Custom tool definitions:
- Files:
backend/tools/calculator-tool.ts,backend/tools/scratchpad-tool.tsx - Features: Tool creation, execution, rendering
Channels
Real-time updates:
- Files:
backend/channels/todo-list.channel.ts,backend/routes/channels.ts - Features: Channel definition, publishing, subscribing
Client Integration
React
- Files:
frontend-react/src/App.tsx,frontend-react/src/hooks/ - Hooks:
useEngineClient,useExecution,useChannel
Angular
- Files:
frontend-angular/src/app/ - Services:
EngineService,ExecutionService,ChannelService
Persistence
Database integration:
- Files:
backend/persistence/ - Features: Execution tracking, message logging, metrics
Next Steps
Explore a specific example:
Simple Chat
Basic chat agent with streaming responses.
Task Assistant
Full-stack app with tools, channels, and React.
Multi-Agent
Model-driven orchestration with Component Tools and Fork/Spawn.
Dynamic Router
Smart model selection based on task and cost.
User Memory
Tools that remember user context and personalize responses.
Voting Consensus
Multi-agent voting for near-zero error rates. Inspired by MAKER.
Progressive Adoption
Start simple, add features incrementally as needs grow.