Installation

Get up and running in 60 seconds ⚑

Quick Install

pip install memofai

That's it! You're ready to go. πŸŽ‰

Requirements

  • Python: 3.8 or higher
  • pip: Latest version recommended
# Check your Python version
python --version

# Should output: Python 3.8.x or higher

Installation Methods

# Basic install
pip install memofai

# Upgrade to latest
pip install --upgrade memofai

# Install specific version
pip install memofai==1.0.0

Using pip with virtual environment

# Create virtual environment
python -m venv venv

# Activate it
source venv/bin/activate  # Unix/macOS
.\venv\Scripts\activate   # Windows

# Install memofai
pip install memofai

Using Poetry

poetry add memofai

Using Pipenv

pipenv install memofai

Verify Installation

python -c "import memofai; print(memofai.__version__)"

Should output something like: 1.0.0

Optional Dependencies

Development Dependencies

If you're contributing or want to run tests:

pip install memofai[dev]

Async Support

Already included! No extra dependencies needed.

from memofai import create_async_moa_client  # Ready to use!

Environment Setup

1. Get Your API Token

Visit memof.ai and grab your API token.

2. Set Environment Variable

Unix/macOS:

export MEMOFAI_TOKEN="moa_your_token_here"

# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export MEMOFAI_TOKEN="moa_your_token_here"' >> ~/.zshrc

Windows (PowerShell):

$env:MEMOFAI_TOKEN = "moa_your_token_here"

# For persistence
[System.Environment]::SetEnvironmentVariable('MEMOFAI_TOKEN', 'moa_your_token_here', 'User')

Windows (CMD):

set MEMOFAI_TOKEN=moa_your_token_here

Create .env file:

MEMOFAI_TOKEN=moa_your_token_here
MEMOFAI_ENVIRONMENT=production

Install python-dotenv:

pip install python-dotenv

Use in code:

from dotenv import load_dotenv
import os

load_dotenv()

from memofai import create_moa_client

client = create_moa_client(
    api_token=os.getenv('MEMOFAI_TOKEN'),
    environment=os.getenv('MEMOFAI_ENVIRONMENT')
)

Quick Test

from memofai import create_moa_client
import os

# Initialize client
client = create_moa_client(
    api_token=os.getenv('MEMOFAI_TOKEN'),
    environment='production'
)

# Test connection
try:
    workspaces = client.workspaces.list()
    print(f"βœ… Connected! Found {len(workspaces)} workspaces.")
except Exception as e:
    print(f"❌ Connection failed: {e}")

Troubleshooting

"No module named 'memofai'"

Solution: SDK not installed

pip install memofai

"ModuleNotFoundError" in virtual environment

Solution: Wrong Python environment

# Make sure venv is activated
source venv/bin/activate  # Unix
.\venv\Scripts\activate   # Windows

# Then install
pip install memofai

"Permission denied" error

Solution: Install for user only

pip install --user memofai

Or use virtual environment (recommended).

Outdated pip warning

Solution: Upgrade pip

pip install --upgrade pip

IDE Setup

VS Code

Install Python extension, then SDK will have full autocomplete!

// .vscode/settings.json
{
  "python.analysis.typeCheckingMode": "basic",
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true
}

PyCharm

Works out of the box with full type hints!

  1. Open Settings β†’ Project β†’ Python Interpreter
  2. Click + and search for memofai
  3. Install
  4. Enjoy autocomplete! ✨

Docker

Dockerfile

FROM python:3.11-slim

WORKDIR /app

# Install memofai
RUN pip install --no-cache-dir memofai

# Copy your code
COPY . .

# Set environment variable
ENV MEMOFAI_TOKEN="moa_your_token_here"

CMD ["python", "app.py"]

docker-compose.yml

version: '3.8'

services:
  app:
    build: .
    environment:
      - MEMOFAI_TOKEN=${MEMOFAI_TOKEN}
      - MEMOFAI_ENVIRONMENT=production
    volumes:
      - .:/app

Next Steps

Installation complete! Now what?

Need Help?


Ready to build? β†’ Quick Start Guide