Skip to documentation
Docs navigation
Docs/Install MemoGrafter and prepare the database
Setup

Install MemoGrafter and prepare the database.

MemoGrafter runs server-side on Node.js and uses PostgreSQL with pgvector for the built-in storage backend.

Requirements

Node.js 18 or newer.
TypeScript or modern JavaScript using ES modules.
PostgreSQL with the pgvector extension for the built-in PostgresGraphStore.
An LLM adapter and an embedding adapter.
Redis only when enabling queue mode or the optional recall cache.

Install the package

Install MemoGrafter from npm in the server-side package where your chatbot or memory workflow runs.

terminal
# Add the MemoGrafter runtime to your server-side app.
npm install memo-grafter

Initialize project files

Create the generated MemoGrafter config and schema files. These files live under src/memo-grafter/ so they are easy to review and keep separate from your application code.

terminal
# Generate MemoGrafter config and schema files.
npx memo-grafter init

Create the database schema

Run the migration command after setting DATABASE_URL. MemoGrafter owns only its mg_* tables and required PostgreSQL extensions.

terminal
# Create or update only MemoGrafter-owned database tables.
npx memo-grafter migrate

Migration boundary

memo-grafter migrate manages only MemoGrafter-owned mg_* tables and PostgreSQL extensions. Application tables remain in your existing Prisma, Drizzle, SQL, or custom migration workflow.