Memory

Setup & Installation

Guide to installing and running the Memory engine

This guide will help you set up and run the Memory engine locally.

Prerequisites

Before starting, ensure you have the following installed:

  • Bun: The JavaScript runtime used by this project.
  • PostgreSQL: Rational database for storing memory metadata.
  • Qdrant: Vector database for storing embeddings.

Installation

  1. Clone the repository:

    git clone https://github.com/sincerelyyyash/memory
    cd memory
  2. Install dependencies:

    bun install

Configuration

  1. Copy the example environment file:

    cp .env.example .env
  2. Configure the environment variables in .env:

    VariableDescriptionDefault
    PORTAPI Port8000
    OPENROUTER_API_KEYAPI Key for LLM services-
    DATABASE_URLPostgreSQL connection string-
    QDRANT_URLURL of your Qdrant instance-
    QDRANT_API_KEYAPI Key for Qdrant (if auth enabled)-
    EMBEDDING_MODELModel for generating embeddingsopenai/text-embedding-3-small
    EMBEDDING_DIMENSIONDimension of the embedding vectorsMatches model
    ANSWER_MODELModel for RAG answer generationgpt-4o-mini
    FACT_MODELModel for fact extractiongpt-4o-mini
    QDRANT_COLLECTION_NAMEName of the Qdrant collection-
    RERANK_MODELModel for rerankinggpt-4o-mini
    RERANK_ENABLEDEnable reranking by defaultfalse
    RERANK_TOP_KNumber of documents to rerank-
    PROCEDURAL_MODELModel for procedural summary generationgpt-4o-mini
    NODE_ENVEnvironment (e.g., development, production)-

Database Setup

  1. Generate the Prisma client:

    bun x prisma generate
  2. Push the schema to your database:

    bun x prisma db push

Running the Engine

Start the development server:

bun run index.ts

The server will start on the configured PORT (default: 8000).

On this page