Basic Graphs
Create simple workflow graphs to orchestrate multi-step processes. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus...
Create simple workflow graphs to orchestrate multi-step processes.
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/basic-graphs
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 Graph Workflow
import { Agent, Graph } from '@astreus-ai/astreus';
// Create an agent
const agent = await Agent.create({
name: 'WorkflowAgent',
model: 'gpt-4o'
});
// Create a simple sequential graph
const graph = new Graph({
name: 'research-workflow'
}, agent);
// Add tasks with dependencies
const research = graph.addTaskNode({
prompt: 'Research artificial intelligence trends'
});
const summary = graph.addTaskNode({
prompt: 'Summarize the research findings',
dependencies: [research]
});
// Execute the workflow
const results = await graph.run();
// Parse the result and extract the response
if (results.success && results.results[summary]) {
const summaryResult = JSON.parse(results.results[summary]);
console.log(summaryResult.response);
}Running the Example
If you cloned the repository:
npm run devRepository
The complete example is available on GitHub: examples/basic-graphs
Last updated: July 6, 2026
In this section
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.
Agent with Memory
Build agents with persistent memory capabilities. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus agent systems.
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.