Troubleshooting

Quick fixes for the most common Memori issues.

Installation

Python: pip install memori fails — Requires Python 3.10+. Run python --version to check, then pip install --upgrade pip && pip install memori.

Python: Missing binary deps — Install prerequisites first: pip install numpy>=1.24.0 sentence-transformers>=3.0.0 memori.

TypeScript: npm install @memorilabs/memori fails — Requires Node.js 20+. Run node --version to check.

Database Connection

Python: No connection factory provided — You must pass conn when initializing:

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from memori import Memori

engine = create_engine("sqlite:///memori.db")
SessionLocal = sessionmaker(bind=engine)
mem = Memori(conn=SessionLocal)

Table does not exist — Run build() once after initialization or after upgrading:

Build Schema
mem.config.storage.build()

Python: Connection pool errors — Enable pre-ping and recycling:

engine = create_engine("postgresql+psycopg2://user:pass@host/db", pool_pre_ping=True, pool_recycle=300)

Connection string formats:

DatabaseFormat
SQLitesqlite:///memori.db
PostgreSQLpostgresql+psycopg2://user:pass@host:5432/db
MySQLmysql+pymysql://user:pass@host:3306/db
TiDBmysql+pymysql://user:pass@host:4000/db?charset=utf8mb4

No Memories Being Created

  1. Set attribution before LLM calls — without it, no memories are stored:
Set Attribution
mem.attribution(entity_id="user_123", process_id="my_app")
  1. Wait for augmentation in short-lived scripts:
Wait for Augmentation
mem.augmentation.wait()
  1. Register your LLM client — conversations aren't captured without registration:
Register LLM Client
client = OpenAI()
mem = Memori(conn=SessionLocal).llm.register(client)

Recall Returns Empty

  • Verify entity_id matches what was used when memories were created
  • Wait for augmentation:
Wait for Augmentation
mem.augmentation.wait()
  • Python: Increase limit: mem.recall("query", limit=10)
  • Lower threshold:
Lower Recall Threshold
mem.config.recall_relevance_threshold = 0.05

Quota Exceeded

Quota Exceeded Error
# QuotaExceededError: your IP address is over quota

Sign up for a free API key at app.memorilabs.ai - gives 5,000/month. Set it via export MEMORI_API_KEY="your-key".

Performance

Python: Slow first run — Memori downloads the embedding model on first use. Pre-download with python -m memori setup.

Python: High memory usage — Reduce embeddings limit: mem.config.recall_embeddings_limit = 500. Use PostgreSQL for production.

Network timeouts:

Network Timeout
mem.config.request_secs_timeout = 10
mem.config.request_num_backoff = 10

Debug Logging

import logging
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s | %(name)s | %(levelname)s | %(message)s")

from memori import Memori
mem = Memori(conn=SessionLocal, debug_truncate=False)

Getting Help

If you need help troubleshooting an issue, please reach out on Discord with more details and we will be happy to assist you.

For Python: include your Python version, Memori version (pip show memori), database type, and full error trace.

For TypeScript: include your Node.js version, Memori version (npm list @memorilabs/memori), database type, and full error trace.