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: May 26, 2026