Agent with Memory
Build agents with persistent memory capabilities. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus agent systems.
Build agents with persistent memory capabilities.
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/agent-with-memory
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
# Database for memory storage
DB_URL=sqlite://./astreus.dbMemory Agent
import { Agent } from '@astreus-ai/astreus';
const agent = await Agent.create({
name: 'MemoryBot',
model: 'gpt-4o',
memory: true,
systemPrompt: 'You remember our conversation history.'
});
// First conversation
const response1 = await agent.ask("My name is John and I like TypeScript");
console.log(response1);
// Later conversation - agent remembers
const response2 = await agent.ask("What's my name and what do I like?");
console.log(response2); // Should remember John and TypeScriptRunning the Example
If you cloned the repository:
npm run devRepository
The complete example is available on GitHub: examples/agent-with-memory
Last updated: July 6, 2026
In this section
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.
Basic Graphs
Create simple workflow graphs to orchestrate multi-step processes. Learn the setup patterns, APIs, and practical examples needed to build reliable Astreus...