Installation
Prerequisites
Before installing Souvenir, ensure you have:
- Node.js 20+, Bun, or Deno
- PostgreSQL with pgvector extension
- An embedding provider (OpenAI, Cohere, or custom)
Install Package
bash
npm install @upstart.gg/souvenir ai zodDatabase Setup
1. Install PostgreSQL
If you don't have PostgreSQL installed:
bash
brew install postgresql@16
brew services start postgresql@162. Install pgvector
Install the pgvector extension:
bash
brew install pgvector3. Create Database
bash
createdb souvenirOr via SQL:
sql
CREATE DATABASE souvenir;4. Run Migrations
Souvenir uses dbmate for migrations. Install it:
bash
brew install dbmateRun the migrations:
bash
cd node_modules/@upstart.gg/souvenir
dbmate -d db/migrations -u "postgresql://localhost:5432/souvenir?sslmode=disable" upOr manually execute the SQL from node_modules/@upstart.gg/souvenir/db/migrations/.
Verify Installation
Create a test file to verify everything works:
typescript
import { Souvenir } from '@upstart.gg/souvenir';
const souvenir = new Souvenir({
databaseUrl: 'postgresql://localhost:5432/souvenir?sslmode=disable',
embeddingDimensions: 1536,
chunkSize: 1000,
chunkOverlap: 200,
});
console.log('Souvenir initialized successfully!');
await souvenir.close();Run it:
bash
node --loader ts-node/esm test.tsIf you see "Souvenir initialized successfully!", you're ready to go!
Next Steps
- Quick Start - Build your first memory-enabled agent
- Configuration - Learn about configuration options