Your First Agent
Create your first AI agent with Astreus framework. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus agent systems.
Create your first AI agent with Astreus framework.
Quick Start
Clone the Complete Example
The easiest way to get started is to clone the complete example repository:
git clone https://github.com/astreus-ai/examples
cd examples/your-first-agent
npm installOr Install Package Only
If you prefer to build from scratch:
npm install @astreus-ai/astreusEnvironment Setup
# .env
OPENAI_API_KEY=sk-your-openai-api-key-here
DB_URL=sqlite://./astreus.dbBasic Agent
import { Agent } from '@astreus-ai/astreus';
const agent = await Agent.create({
name: 'MyFirstAgent',
model: 'gpt-4o',
systemPrompt: 'You are a helpful assistant.'
});
// Create and execute a task
const task = await agent.createTask({
prompt: "Hello, introduce yourself"
});
const result = await agent.executeTask(task.id);
console.log(result.response);Running the Example
If you cloned the repository:
npm run devIf you built from scratch, create an index.ts file with the code above and run:
npx tsx index.tsRepository
The complete example is available on GitHub: examples/your-first-agent
Last updated: July 6, 2026
In this section
Agent with Knowledge
Create agents with knowledge base capabilities for enhanced information retrieval. Learn the setup patterns, APIs, and practical examples needed to build...
Agent with Vision
Create agents capable of processing and analyzing images. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus agent systems.
Basic Sub-Agents
Create and coordinate multiple AI agents for complex task delegation. Learn the setup patterns, APIs, and practical examples needed to build reliable...
Advanced Sub-Agents
Build sophisticated multi-agent workflows with complex coordination patterns and specialized capabilities.