$npx -y skills add acnlabs/OpenPersona --skill persona-knowledgePersistent, incremental, searchable persona knowledge base. Ingests data from Obsidian vaults, chat exports, X/Twitter archives, and more into a MemPalace-backed store with a Karpathy LLM Wiki knowledge layer. Exports training/ directories for persona-model-trainer.
| 1 | # persona-knowledge |
| 2 | |
| 3 | Persistent, incremental, searchable persona knowledge base — the **data layer** between raw sources and persona training. |
| 4 | |
| 5 | **Architecture**: MemPalace (storage + search) + Knowledge Graph (relationships + timeline) + Karpathy LLM Wiki (knowledge accumulation) |
| 6 | |
| 7 | **Dependency chain**: `data sources` → `persona-knowledge` → `anyone-skill` / `persona-model-trainer` |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## When to use this skill |
| 12 | |
| 13 | Trigger phrases: |
| 14 | |
| 15 | - "create a dataset for this persona" |
| 16 | - "add data to the dataset" |
| 17 | - "import my Obsidian vault" |
| 18 | - "import my Twitter archive" |
| 19 | - "build a knowledge base for X" |
| 20 | - "export training data" |
| 21 | - "search the persona dataset" |
| 22 | |
| 23 | **Not suitable when:** |
| 24 | |
| 25 | - User wants a quick one-shot distillation without persistent storage (use anyone-skill alone) |
| 26 | - User only has < 50 messages of data (too little to warrant a dataset) |
| 27 | |
| 28 | --- |
| 29 | |
| 30 | ## Phase 1: Init |
| 31 | |
| 32 | Create a new persona dataset: |
| 33 | |
| 34 | ```bash |
| 35 | python scripts/init_knowledge.py --slug {slug} --name "Display Name" |
| 36 | ``` |
| 37 | |
| 38 | This creates `~/.openpersona/knowledge/{slug}/` with: |
| 39 | |
| 40 | ``` |
| 41 | ~/.openpersona/knowledge/{slug}/ |
| 42 | dataset.json # metadata: slug, name, created_at, stats |
| 43 | .mempalace/ # MemPalace local data (per-dataset isolation via palace_path) |
| 44 | palace/ # MemPalace internal store (ChromaDB + KG) |
| 45 | sources/ # immutable source file backups |
| 46 | .source-index.json # per-file metadata: hash, import time, line count, PII flags |
| 47 | wiki/ # Karpathy wiki (LLM-maintained derived artifact) |
| 48 | _schema.md # wiki maintenance rules |
| 49 | identity.md |
| 50 | voice.md |
| 51 | values.md |
| 52 | thinking.md |
| 53 | relationships.md # generated from Knowledge Graph |
| 54 | timeline.md # generated from Knowledge Graph |
| 55 | _contradictions.md |
| 56 | _changelog.md |
| 57 | _evidence.md |
| 58 | ``` |
| 59 | |
| 60 | MemPalace palace structure: |
| 61 | - One Wing per persona (named by slug) |
| 62 | - Halls mapped to 5 persona dimensions: |
| 63 | - `hall_facts` — Identity (background, career, education) |
| 64 | - `hall_events` — Memory (key events, turning points) |
| 65 | - `hall_preferences` — Personality (values, preferences, boundaries) |
| 66 | - `hall_discoveries` — Procedure (mental models, decision heuristics) |
| 67 | - `hall_voice` — Interaction (vocabulary, rhythm, humor, emotional temperature) |
| 68 | |
| 69 | **Gate**: Confirm slug and display name with the user before proceeding. |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Phase 2: Ingest |
| 74 | |
| 75 | Import data sources into the dataset. Can be called multiple times for incremental ingestion. |
| 76 | |
| 77 | ```bash |
| 78 | python scripts/ingest.py --slug {slug} --source <path> [--adapter <name>] [--since <date>] |
| 79 | ``` |
| 80 | |
| 81 | **Three adapters** cover all supported formats: |
| 82 | |
| 83 | | Source | Adapter | Detection | |
| 84 | |--------|---------|-----------| |
| 85 | | Obsidian vault | `universal` | Directory containing `.obsidian/` or `*.md` files | |
| 86 | | GBrain export dir | `universal` | Markdown directory with `.raw/` sidecar dirs | |
| 87 | | `.md` / `.txt` / `.csv` / `.pdf` | `universal` | File extension | |
| 88 | | `.jsonl` / `.json` | `universal` | File extension | |
| 89 | | GBrain JSON export | `universal` | `.json` with `memories` key or `--entity` flag | |
| 90 | | WhatsApp `.txt` export | `chat_export` | Matches WhatsApp timestamp pattern | |
| 91 | | Telegram `result.json` | `chat_export` | JSON with `chats` key | |
| 92 | | Signal export | `chat_export` | JSON with Signal message format | |
| 93 | | iMessage `.db` | `chat_export` | SQLite with `message` + `handle` tables | |
| 94 | | X (Twitter) archive | `social` | Directory containing `data/tweets.js` | |
| 95 | | Instagram archive | `social` | Directory containing `content/posts_1.json` | |
| 96 | |
| 97 | |
| 98 | **Ingest pipeline** (per source): |
| 99 | |
| 100 | 1. **Parse** — adapter converts source to unified `[{role, content, timestamp, source_file, source_type}]` |
| 101 | 2. **PII scan** — flag SSN, credit card, email, password patterns |
| 102 | 3. **Hash dedup** — SHA-256 content hash, skip already-ingested entries |
| 103 | 4. **Write sources/** — save parsed data as JSONL backup (immutable, one file per source) |
| 104 | 5. **Store in MemPalace** — verbatim text into ChromaDB via palace wing/hall structure |
| 105 | 6. **Extract KG triples** — detect entities and relationships, write to Knowledge Graph with temporal validity |
| 106 | 7. **Report** — print source name, message count, assistant turns, PII flags, new KG entities |
| 107 | |
| 108 | After each source is ingested, report: |
| 109 | |
| 110 | ``` |
| 111 | ✅ whatsapp-2024.txt → 1,247 messages (892 assista |