Development Setup

This guide walks you through setting up a local development environment for working on the Memori codebase. Follow these steps to clone the repository, install dependencies, and run the test suite.

Want a zero-setup option? The Memori Cloud at app.memorilabs.ai.

Prerequisites

Before you begin, make sure you have the following installed on your system:

  • git — For cloning the repository and managing branches.

Python:

  • Python 3.10 or higher — Check your version with python --version.
  • pip — Python's package manager (usually included with Python).

TypeScript:

  • Node.js 20 or higher — Check your version with node --version.

Clone the Repository

Start by forking the repository on GitHub, then clone your fork locally:

git clone https://github.com/YOUR_USERNAME/Memori.git
cd Memori

If you plan to submit a pull request, make sure to keep your fork synced with the upstream repository:

git remote add upstream https://github.com/MemoriLabs/Memori.git
git fetch upstream

Install Dependencies

Install Dependencies
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate    # macOS/Linux
# .venv\Scripts\activate     # Windows

# Install with development dependencies
pip install -e ".[dev]"

The Python -e flag installs Memori in editable mode so changes to the source code are immediately reflected without reinstalling. The [dev] extra includes testing and linting tools.

Running Tests

Run Tests
# Run all tests
pytest

# Run with verbose output
pytest -v

# Run a specific test file
pytest tests/test_config.py

# Run with coverage
pytest --cov=memori --cov-report=term-missing

Local Development Workflow

Here is a typical workflow for making changes to Memori:

  1. Create a branch for your feature or fix:

    git checkout -b feat/my-new-feature
    
  2. Make your changes — Edit the source code in the memori/ directory (Python) or memori-ts/src/ directory (TypeScript).

  3. Write tests — Add or update tests in the tests/ directory (Python) or memori-ts/ (TypeScript) to cover your changes.

  4. Run the tests to make sure nothing is broken:

    Run Tests
    pytest
    
  5. Check code style:

    Code Style
    # Lint
    ruff check .
    
    # Format
    ruff format --check .
    
  6. Commit your changes with a descriptive message:

    git add .
    git commit -m "feat: add support for Redis storage backend"
    
  7. Push to your fork and open a pull request:

    git push origin feat/my-new-feature
    

Project Structure

Here is a high-level overview of the Memori repository structure:

DirectoryPurpose
memori/Python library source code
memori-ts/TypeScript library source code
tests/Python test suite (pytest)
docs/Documentation source files
examples/Example scripts and usage demos

The core integration logic for each LLM provider lives in separate modules within memori/ (Python) and memori-ts/src/ (TypeScript). When adding support for a new provider, look at existing integrations (such as OpenAI or Anthropic) as templates.