Persona Knowledge logo

Persona Knowledge

Organization
acnlabs
persona-knowledge

Persistent, 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.

Overview

Publisheracnlabs
RepositoryOpenPersona
Skill namepersona-knowledge
Stars
56
Forks
5
Bundled files
14
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 14 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by acnlabs on GitHub. Read the source before you install it.

Installation

Install the Persona Knowledge AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/acnlabs/OpenPersona/tree/main/skills/persona-knowledge
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/acnlabs/OpenPersona.git /tmp/OpenPersona
mkdir -p .claude/skills
cp -r /tmp/OpenPersona/skills/persona-knowledge .claude/skills/persona-knowledge
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Persona Knowledge in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Persona Knowledge on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Persona Knowledge is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

persona-knowledge

Persistent, incremental, searchable persona knowledge base — the data layer between raw sources and persona training.

Architecture: MemPalace (storage + search) + Knowledge Graph (relationships + timeline) + Karpathy LLM Wiki (knowledge accumulation)

Dependency chain: data sources → persona-knowledge → anyone-skill / persona-model-trainer


When to use this skill

Trigger phrases:

  • "create a dataset for this persona"
  • "add data to the dataset"
  • "import my Obsidian vault"
  • "import my Twitter archive"
  • "build a knowledge base for X"
  • "export training data"
  • "search the persona dataset"

Not suitable when:

  • User wants a quick one-shot distillation without persistent storage (use anyone-skill alone)
  • User only has < 50 messages of data (too little to warrant a dataset)

Phase 1: Init

Create a new persona dataset:

bash
python scripts/init_knowledge.py --slug {slug} --name "Display Name"

This creates ~/.openpersona/knowledge/{slug}/ with:

~/.openpersona/knowledge/{slug}/
  dataset.json                 # metadata: slug, name, created_at, stats
  .mempalace/                  # MemPalace local data (per-dataset isolation via palace_path)
    palace/                    # MemPalace internal store (ChromaDB + KG)
  sources/                     # immutable source file backups
    .source-index.json         # per-file metadata: hash, import time, line count, PII flags
  wiki/                        # Karpathy wiki (LLM-maintained derived artifact)
    _schema.md                 # wiki maintenance rules
    identity.md
    voice.md
    values.md
    thinking.md
    relationships.md           # generated from Knowledge Graph
    timeline.md                # generated from Knowledge Graph
    _contradictions.md
    _changelog.md
    _evidence.md

MemPalace palace structure:

  • One Wing per persona (named by slug)
  • Halls mapped to 5 persona dimensions:
    • hall_facts — Identity (background, career, education)
    • hall_events — Memory (key events, turning points)
    • hall_preferences — Personality (values, preferences, boundaries)
    • hall_discoveries — Procedure (mental models, decision heuristics)
    • hall_voice — Interaction (vocabulary, rhythm, humor, emotional temperature)

Gate: Confirm slug and display name with the user before proceeding.


Phase 2: Ingest

Import data sources into the dataset. Can be called multiple times for incremental ingestion.

bash
python scripts/ingest.py --slug {slug} --source <path> [--adapter <name>] [--since <date>]

Three adapters cover all supported formats:

SourceAdapterDetection
Obsidian vaultuniversalDirectory containing .obsidian/ or *.md files
GBrain export diruniversalMarkdown directory with .raw/ sidecar dirs
.md / .txt / .csv / .pdfuniversalFile extension
.jsonl / .jsonuniversalFile extension
GBrain JSON exportuniversal.json with memories key or --entity flag
WhatsApp .txt exportchat_exportMatches WhatsApp timestamp pattern
Telegram result.jsonchat_exportJSON with chats key
Signal exportchat_exportJSON with Signal message format
iMessage .dbchat_exportSQLite with message + handle tables
X (Twitter) archivesocialDirectory containing data/tweets.js
Instagram archivesocialDirectory containing content/posts_1.json

Ingest pipeline (per source):

  1. Parse — adapter converts source to unified [{role, content, timestamp, source_file, source_type}]
  2. PII scan — flag SSN, credit card, email, password patterns
  3. Hash dedup — SHA-256 content hash, skip already-ingested entries
  4. Write sources/ — save parsed data as JSONL backup (immutable, one file per source)
  5. Store in MemPalace — verbatim text into ChromaDB via palace wing/hall structure
  6. Extract KG triples — detect entities and relationships, write to Knowledge Graph with temporal validity
  7. Report — print source name, message count, assistant turns, PII flags, new KG entities

After each source is ingested, report:

✅ whatsapp-2024.txt → 1,247 messages (892 assistant turns)
   PII: none detected
   KG: +3 entities, +7 relationships
   → sources/whatsapp-2024.jsonl

Phase 3: Wiki Build (agent task — not a script)

After ingesting new data, the agent reads MemPalace content and Knowledge Graph relationships, then builds or updates the wiki pages following the Karpathy LLM Wiki pattern.

This phase is driven by agent intelligence (SKILL.md instructions), not by automated scripts. The LLM decides which pages to update, how to phrase entries, and how to tag evidence.

Ingest operation (after each Phase 2 run)

  1. Read new data from MemPalace (search the wing for recently added entries)
  2. For each relevant wiki page, check if the new data adds, contradicts, or refines existing content
  3. Update 5-15 wiki pages with new information, using evidence tags:
    • [L1:source] — direct quote, traceable
    • [L2] — reported/paraphrased, verifiable
    • [L3:inferred] — reasonably inferred from multiple signals
    • [L4:inspired] — impression-based
  4. Add backlinks between related pages using [[page]] wikilink syntax
  5. Record contradictions in _contradictions.md with both sides cited
  6. Append entry to _changelog.md
  7. Update counts in _evidence.md

Query operation

When the user asks a question about the persona:

  1. Search MemPalace semantically for relevant memories
  2. Navigate wiki pages for structured knowledge
  3. Synthesize an answer
  4. If the query reveals new insights, write them back to the appropriate wiki page

Lint operation

Run periodically or before export:

bash
python scripts/lint_wiki.py --slug {slug}

Checks:

  • Broken [[links]] (referenced page doesn't exist)
  • Empty pages (created but never populated)
  • Contradictions without resolution notes
  • Evidence coverage (pages with < 2 evidence tags)
  • Source coverage (MemPalace entries not reflected in any wiki page)

Wiki page structure (see references/wiki-schema.md for full spec)

Each page follows this template:

markdown
# {Page Title}

> One-sentence summary of this page's scope.

## Content

{Structured content with [L?:source] evidence tags and [[backlinks]]}

## Sources

- {source_file}: {what was extracted} [L?]

## See also

- [[related_page]]

Knowledge Graph–driven pages

relationships.md and timeline.md are generated from the Knowledge Graph, not written freehand:

python
from mempalace.knowledge_graph import KnowledgeGraph
kg = KnowledgeGraph(palace_path)
kg.timeline(slug)           # → chronological event list for timeline.md
kg.query_entity(slug)       # → current relationships for relationships.md

After generating, the agent may annotate with evidence tags and additional context.


Phase 4: Export

Generate a training/ directory compatible with persona-model-trainer:

bash
python scripts/export_training.py --slug {slug} --output training/

Each export is automatically versioned (v1, v2, …). Override with --version:

bash
python scripts/export_training.py --slug {slug} --output training/ --version v3

List export history:

bash
python scripts/export_training.py --slug {slug} --list
# v1  2026-04-01 10:00  142 turns  sha256:a3f9c2d1  3 sources
# v2  2026-04-10 14:22  198 turns  sha256:c7d2e1f3  4 sources

Output:

training/
  raw/                      # copied from sources/ (authentic voice, unmodified)
  conversations.jsonl       # generated from wiki pages (structured Q-A pairs)
  profile.md                # summarized from wiki identity/voice/values
  metadata.json             # slug, source count, turn count, export version + hash

How each file is built:

  • training/raw/ — direct copy of sources/*.jsonl and sources/*.txt files
  • training/conversations.jsonl — the agent reads wiki pages and generates distilled user/assistant turn pairs representing the persona's voice, knowledge, and values
  • training/profile.md — 300-500 word character sheet derived from identity.md, voice.md, values.md
  • training/metadata.json — slug, name, subject_type, created_at, source_count, total_words, distilled_turns, raw_files + versioning fields:
    • export_version — version tag (e.g. "v2")
    • export_hash — SHA-256 of conversations.jsonl (e.g. "sha256:c7d2e1f3...")
    • source_snapshot — {filename: sha256_hash} dict of all source files at export time

Export history is appended to dataset.json → export_history[] after each run.

Downstream traceability: persona-model-trainer's pipeline.sh reads export_version and export_hash from metadata.json and injects them as dataset_version / dataset_export_hash into training_summary.json, forming a complete provenance chain from source data to trained model adapter.

This output is directly consumable by persona-model-trainer's prepare_data.py — no changes needed downstream.

→ Next step — train a local persona model:

bash
bash skills/persona-model-trainer/scripts/pipeline.sh \
  --slug {slug} \
  --model google/gemma-4-E4B-it \
  --source ./training \
  --method mlx \       # or: unsloth (NVIDIA GPU) / colab (no GPU)
  --preset gemma4 \
  --probes ./training/probes.json

Full guide: persona-model-trainer/references/pipeline-guide.md


Phase 5: Search

Query the dataset using MemPalace's semantic search and Knowledge Graph:

bash
# Semantic search across all stored memories
mempalace search "how does this person handle conflict" --wing {slug}

# Knowledge Graph: look up an entity's relationships
python scripts/query_kg.py --slug {slug} --entity "Tom"

# Knowledge Graph: shortest path between two entities
python scripts/query_kg.py --slug {slug} --path "Tom" "Alice"

# Knowledge Graph: overall statistics
python scripts/query_kg.py --slug {slug} --stats

# Knowledge Graph: JSON output (for programmatic use)
python scripts/query_kg.py --slug {slug} --entity "Tom" --json

# Wake-up summary (~170 tokens)
mempalace wake-up --wing {slug}

The agent can also search programmatically during wiki build or distillation:

python
from mempalace.searcher import search_memories
results = search_memories("vocabulary patterns", palace_path="~/.openpersona/knowledge/{slug}/.mempalace/palace")

Phase 6: Maintain

Ongoing dataset management:

  • Add new source: run Phase 2 (Ingest) again with new files → triggers wiki update
  • Remove source: delete from sources/ + re-index → run wiki lint to flag orphaned content
  • Wiki lint: python scripts/lint_wiki.py --slug {slug} — health check
  • Dataset stats: python scripts/init_knowledge.py --slug {slug} --stats — show current stats
  • List datasets: ls ~/.openpersona/knowledge/ — all available datasets

Tools

ToolPurpose
BashRun init, ingest, export, lint scripts; MemPalace CLI commands
ReadLoad source files, wiki pages, dataset.json
WriteUpdate wiki pages, write training exports
WebSearchFetch public figure data for ingestion

Scripts

ScriptPurpose
scripts/init_knowledge.pyInitialize knowledge directory + MemPalace wing + KG
scripts/ingest.pyUnified ingestion: adapter dispatch + PII scan + dedup + MemPalace + KG
scripts/export_training.pyExport sources/ + wiki → training/ directory
scripts/lint_wiki.pyWiki health check: broken links, contradictions, coverage gaps
scripts/query_kg.pyKnowledge Graph query: entity lookup, shortest path, statistics

Adapters

AdapterSourcesFormat
universalObsidian vault, GBrain export, .md, .txt, .csv, .pdf, .jsonl, .jsonAll pure file reading
chat_exportWhatsApp / Telegram / Signal / iMessage.txt / JSON / SQLite (special parsing)
socialX (Twitter) / Instagram archiveJS wrapper stripping + archive dirs

References

  • references/wiki-schema.md — Karpathy wiki structure specification and maintenance rules
  • references/source-formats.md — supported data source formats and adapter details

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Persona Knowledge AI skill do?

Persistent, 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.

Why use Persona Knowledge on TypingMind?

Because you install it once and use it with any model. Persona Knowledge is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Persona Knowledge in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/acnlabs/OpenPersona/tree/main/skills/persona-knowledge. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Persona Knowledge?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Persona Knowledge?

As many as you like. As long as a model supports skills, you can use Persona Knowledge with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Persona Knowledge AI skill free?

Yes. It is published on GitHub by acnlabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇