1. Create Your Project
The fastest way to start is with the CLI:2. Understanding main.ts
Every Runflow agent needs a main.ts file at the project root. It must export an async function main() — this is the function the Runflow engine calls when your agent receives a message.
3. Add Memory
Enable conversation history so your agent remembers previous messages:4. Add a Tool
Tools let your agent perform actions — call APIs, query databases, send messages. Create them in separate files undertools/:
tools/weather.ts
main.ts
5. Test Locally
Run the interactive testing interface:- Chat with your agent in real time
- See which tools are being called
- Inspect memory and trace data
- Test conversation continuity
6. Add Business Metrics
Usetrack() to emit events that power dashboards in the Runflow portal:
main.ts
7. Deploy
When you’re ready, deploy to production:Next Steps
Project Structure
Learn how to organize your project as it grows
Best Practices
Tips for writing effective agents
Core Concepts
Deep dive into Agents, Memory, Tools, and more
Real-World Examples
See production-ready examples