Quick Start Guide
Create your first Matrix OS agent in minutes. This guide will walk you through the basics of setting up and running an autonomous agent.
Prerequisites
- Matrix OS installed (see Installation Guide)
- Basic understanding of command line interfaces
- Text editor of your choice
- Terminal or command prompt
Creating Your First Agent
1. Project Setup
First, create a new directory for your agent project and initialize it:
Create and initialize project
# Create project directory
mkdir my-first-agent
cd my-first-agent
# Initialize Matrix OS project
matrix-os init
The initialization wizard will guide you through setting up your project with sensible defaults.
2. Configure Your Agent
Open the generated agent.config.ts
file and customize your agent's behavior:
agent.config.ts
import { defineAgent } from '@matrix-os/core';
export default defineAgent({
name: 'my-first-agent',
description: 'A simple demo agent',
capabilities: ['compute', 'network'],
// Define agent's behavior
behavior: {
onStart: async (context) => {
context.log.info('Agent started!');
},
onMessage: async (message, context) => {
context.log.info('Received message:', message);
return { status: 'received' };
}
}
});
3. Run Your Agent
Start your agent in development mode with live-reload enabled:
Start development mode
matrix-os dev
Your agent is now running! The development mode includes:
- Live-reload on code changes
- Enhanced logging and debugging
- Performance monitoring
4. Test Your Agent
Send a test message to your agent using the Matrix OS CLI:
Send test message
matrix-os message my-first-agent "Hello, Agent!"
Next Steps
Continue your journey with Matrix OS: