Features
Detailed explanation of each feature you can include when scaffolding a new agent. Learn the setup patterns, APIs, and practical examples needed to build...
Detailed explanation of each feature you can include when scaffolding a new agent.
Memory
Enable persistent memory for your agent. The agent remembers conversations across sessions using vector search for efficient retrieval.
const agent = await Agent.create({
name: 'my-agent',
model: 'gpt-4o',
memory: true,
});
await agent.ask("My name is John");
// Later, even in a new session:
await agent.ask("What's my name?"); // "Your name is John"Use cases:
- Personal assistants that remember user preferences
- Customer support bots with conversation history
- Long-running agents that need context persistence
Knowledge (RAG)
Add document retrieval capabilities. Ingest PDFs, text files, and other documents into a searchable knowledge base.
const agent = await Agent.create({
name: 'my-agent',
model: 'gpt-4o',
knowledge: true,
});
// Add documents to knowledge base
await agent.addKnowledgeFromFile('./docs/guide.pdf', { category: 'docs' });
await agent.addKnowledgeFromFile('./docs/api.md', { category: 'api' });
// Agent answers from documents
await agent.ask("What does the guide say about authentication?");Use cases:
- Documentation Q&A bots
- Research assistants
- Knowledge management systems
Requirements: PostgreSQL with pgvector extension
Graph Workflows
Create complex multi-step workflows with DAG-based task orchestration. Define dependencies between tasks and run them in parallel where possible.
import { Agent, Graph } from '@astreus-ai/astreus';
const agent = await Agent.create({ name: 'my-agent', model: 'gpt-4o' });
const graph = new Graph({ name: 'research-workflow' }, agent);
// Define workflow nodes
const researchNode = graph.addTaskNode({
prompt: 'Research the topic thoroughly'
});
const analyzeNode = graph.addTaskNode({
prompt: 'Analyze the research findings',
dependsOn: [researchNode]
});
const writeNode = graph.addTaskNode({
prompt: 'Write a comprehensive report',
dependsOn: [analyzeNode]
});
// Execute the workflow
const result = await graph.run();
console.log(result.results);Use cases:
- Multi-step content generation
- Data processing pipelines
- Complex decision workflows
Sub-Agents
Coordinate multiple specialized agents for complex tasks. Each sub-agent can have its own configuration and expertise.
// Create specialized agents
const researcher = await Agent.create({
name: 'researcher',
model: 'gpt-4o',
systemPrompt: 'You are a research specialist.'
});
const writer = await Agent.create({
name: 'writer',
model: 'gpt-4o',
systemPrompt: 'You are a professional writer.'
});
// Main agent coordinates sub-agents
const agent = await Agent.create({ name: 'coordinator', model: 'gpt-4o' });
const result = await agent.executeWithSubAgents(
'Research and write an article about quantum computing',
[researcher, writer]
);Use cases:
- Content creation pipelines
- Expert systems with multiple domains
- Parallel task execution
Custom Plugins
Extend your agent with custom tools. Define parameters, descriptions, and handlers for each tool.
const weatherPlugin = {
name: 'weather-plugin',
version: '1.0.0',
description: 'Get weather information',
tools: [{
name: 'get_weather',
description: 'Get current weather for a location',
parameters: {
location: {
type: 'string',
description: 'City name',
required: true
}
},
handler: async ({ location }) => {
const response = await fetch(`https://api.weather.com/${location}`);
const data = await response.json();
return { success: true, data };
}
}]
};
const agent = await Agent.create({ name: 'my-agent', model: 'gpt-4o' });
await agent.registerPlugin(weatherPlugin);
// Agent can now use the weather tool
await agent.ask("What's the weather in Tokyo?");Use cases:
- API integrations
- Database operations
- Custom business logic
MCP Integration
Model Context Protocol support for standardized tool integration. Connect to MCP-compatible services and tools.
const agent = await Agent.create({
name: 'my-agent',
model: 'gpt-4o',
mcp: {
servers: [
{ name: 'filesystem', command: 'mcp-server-filesystem' },
{ name: 'github', command: 'mcp-server-github' }
]
}
});Use cases:
- File system operations
- GitHub integration
- Standardized tool ecosystem
Feature Combinations
Features work together seamlessly:
const agent = await Agent.create({
name: 'advanced-agent',
model: 'gpt-4o',
memory: true, // Remember conversations
knowledge: true, // Access documents
mcp: { // Use MCP tools
servers: [
{ name: 'filesystem', command: 'mcp-server-filesystem' }
]
}
});
// Register custom plugins
await agent.registerPlugin(myCustomPlugin);
// Use with graph workflows
const graph = new Graph({ name: 'workflow' }, agent);Last updated: May 26, 2026