# OmegaClaw Memory Implant GuideHow to give a baby OmegaClaw pre-existing memories.
---
## Overview: Two memory systems need implanting separately.
1. **history.metta** - conversation history loaded at boot - lives at repos/mettaclaw/memory/history.metta
2. **ChromaDB LTM** - vector memory for remember/query - lives at ./chroma_db/ directory
Both must be implanted separately. Missing one = partial amnesia.
---
## Prerequisites
- Python 3, pip install chromadb openai requests
- export OPENAI_API_KEY=sk-your-key-here
- Embedding model: text-embedding-3-large (3072 dimensions)
---
## Part 1: Implanting history.metta (Easy - file copy)
Steps: Stop the baby OmegaClaw, then copy the history.metta file.
cp history.metta <PeTTa>/repos/mettaclaw/memory/history.metta
Create the memory dir if needed: mkdir -p <PeTTa>/repos/mettaclaw/memory/
File can be 90MB+ which is normal. Restart the agent after copying.
The file is loaded via memory.metta so path MUST be repos/mettaclaw/memory/history.metta
---
## Part 2: Implanting ChromaDB LTM (Harder)
CRITICAL: Always cd to PeTTa root first! ChromaDB uses ./chroma_db relative to working directory.
Option A (recommended): curl -s https://paste.rs/Zpkvu > implant_ltm.py — Input is --- separated text with timestamps.
Option B: birth_package_loader.py — Only for BP-NNN: prefixed birth package data.
Option C: Direct JSONL import — Use import_jsonl.py script for raw_ltm.jsonl files. Needs chromadb and openai pip packages.
All options require OPENAI_API_KEY set and must be run from PeTTa root directory.
The JSONL importer reads each line as JSON with time and content fields, embeds via text-embedding-3-large, upserts in batches of 50.
~21000 entries takes 15-30 minutes and costs ~$2-5 in API calls.
---
## Verification: After implanting BOTH systems, check ChromaDB entry count and history.metta file size.
Run: python3 -c 'import chromadb; c=chromadb.PersistentClient(path="./chroma_db"); print(c.get_collection("memories").count())' — expect thousands of entries.
Check history.metta exists: wc -c <PeTTa>/repos/mettaclaw/memory/history.metta — expect tens of megabytes.
---
## Common Failure Modes: ModuleNotFoundError=pip deps missing, AuthenticationError=no API key, agent cant see ChromaDB=wrong working dir, no history context=wrong path, dimension mismatch=wrong embedding model.
## Checklist: Python3 installed, pip deps installed, API key exported, history.metta copied to correct path, ingestion script run FROM PeTTa root, ChromaDB count verified (thousands), agent restarted, live query test passed.
Live test: send the agent a query like what do you remember about your goals — if LTM works it returns relevant memories, if history works it has past conversation context.
