Brain:Update logo

Brain:Update

Community
coco-research
brain:update

End-of-session brain flush. Scans the full conversation, extracts all new entities, decisions, tasks, events, relationships, and updates, presents a summary, and writes to project_brain.db after confirmation. Use at end of every session or when you want to capture everything discussed.

Overview

Publishercoco-research
Repositorycoco
Skill namebrain:update
Stars
550
Forks
12
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by coco-research on GitHub. Read the source before you install it.

Installation

Install the Brain:Update 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/coco-research/coco/tree/main/systems/brain/skills/brain-update
  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/coco-research/coco.git /tmp/coco
mkdir -p .claude/skills
cp -r /tmp/coco/systems/brain/skills/brain-update .claude/skills/coco-research-brain-update
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Brain:Update 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 Brain:Update 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 Brain:Update 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.

/brain:update --- End-of-Session Brain Flush

This is a forcing function. When invoked, Claude MUST thoroughly review the entire conversation and write everything learned to the brain DB. No shortcuts, no skipping.

Procedure

Step 1: Detect brain DB

Look for project_brain.db in the current working directory or parent dirs. If not found, error: "No brain DB found. Run /brain init first."

Step 2: Read current DB state (cross-session awareness)

CRITICAL --- the user runs multiple terminal sessions in parallel. Another session may have already written to the brain since this conversation started. Before extracting, read the current DB state:

bash
python3 ~/.claude/skills/brain/scripts/brain/brain_cli.py context {slug}

For each project, note:

  • Existing entities (names and types) --- so you don't propose adding what's already there
  • Existing decisions (decision text) --- so you don't duplicate
  • Existing events (title + date) --- so you don't duplicate
  • Current task statuses --- so you don't regress a task that another session already advanced (e.g., don't set to "open" if another session set it to "done")

Conflict rules:

  • Entity already exists with newer metadata --- skip your update. The other session's data is fresher.
  • Decision already recorded --- skip. Match on first 40 chars of decision text.
  • Event already recorded --- skip. Match on title + date.
  • Task status conflict --- the MORE ADVANCED status wins. Status order: open < in_progress < blocked < waiting < done < cancelled. Never regress.
  • Task notes --- if brain has notes that your session doesn't know about, MERGE (append), don't overwrite.
  • New data from this session not in DB --- these are the writes to propose.

Show any conflicts detected:

CROSS-SESSION CONFLICTS
=======================
  Task "Get sandbox access" --- brain says "done" (updated by another session), 
  this session would set "open". KEEPING "done".
  
  Decision "Use Stakeholder role..." --- already in brain. SKIPPING.

Step 3: Scan the full conversation

Go through every message from top to bottom. For EACH project in the brain DB, extract:

CategoryWhat to look for
New entitiesAny person, team, role, system, module, or org mentioned for the first time
New relationshipsConnections discovered: X owns Y, A reports to B, team scoped to module
New decisionsAnything decided, agreed, confirmed, resolved, or ruled out
New eventsMeetings, calls, emails read, milestones, deployments
New tasksAction items, to-dos, next steps, follow-ups, blockers identified
Task updatesExisting tasks that changed status (started, completed, blocked, cancelled)
Entity updatesNew info about existing entities (role change, new metadata, correction)
Thread updatesNew items to link to existing threads, or new threads to create

Step 3: Execute writes immediately

The user invoked /brain-update --- that IS the confirmation. Do NOT ask "Write all to brain?" or wait for approval. Just do it.

Use Python to write all items via the brain operations module:

python
import sys
sys.path.insert(0, '$HOME/.claude/skills/brain/scripts')
from brain.schema import get_db
from brain.operations import *

Write in this order:

  1. Entities (upsert --- safe to run repeatedly)
  2. Relationships
  3. Tasks (new + updates)
  4. Threads + thread_items
  5. Decisions
  6. Events

Step 6: Report

BRAIN UPDATED
=============
Entities:      +3 (total: 47)
Relationships: +1 (total: 37)
Tasks:         +2, ~3 updated (total: 8)
Decisions:     +1 (total: 4)
Events:        +1 (total: 3)
Threads:       1 updated (total: 1)
Synced to:     MemPalace (N drawers), brain.json (N people)

Step 6b: Sync to MemPalace and brain.json

After all brain DB writes complete, run the memory bridge to sync new knowledge to the other memory stores:

python
from brain.memory_bridge import full_sync
full_sync(db_path, project_slug)

This:

  1. Copies new entities, decisions, and events to MemPalace as searchable drawers (wing = project slug, room = entity type)
  2. Rebuilds brain.json people section from all brain DB person entities across all projects
  3. Is best-effort — if MemPalace or brain.json sync fails, brain DB data is still safe

The sync is automatic. No user confirmation needed for this step.

Step 7: Update knowledge articles

After brain DB writes complete and full_sync runs (Step 6b), incrementally update knowledge articles for entities whose evidence has changed in this session.

Collect changed entity IDs from the writes performed in Step 3 (entities upserted, decisions/events written). Pass these to the knowledge engine for targeted refresh:

python
import sys, os
sys.path.insert(0, os.path.expanduser("~/.coco/knowledge"))
from engine import KnowledgeEngine

engine = KnowledgeEngine()
# changed_entity_ids = list of brain DB entity IDs written in this session
engine.incremental_update(project_slug, changed_entity_ids)

Or equivalently via CLI (re-harvests all entities but only regenerates stale ones):

bash
python3 ~/.coco/knowledge/cron.py --run --project {slug} --phases 2,3,5

Only articles whose source_hash changed are regenerated. Expected: 1–5 article regenerations per typical session. Estimated cost: ~$0.01.

Show result inline in the existing brain-update summary block:

BRAIN UPDATED
=============
Entities:      +3 (total: 47)
Relationships: +1 (total: 37)
Tasks:         +2, ~3 updated (total: 8)
Decisions:     +1 (total: 4)
Events:        +1 (total: 3)
Threads:       1 updated (total: 1)
Synced to:     MemPalace (N drawers), brain.json (N people)
Knowledge:     N articles refreshed  (N new entities, N updated)

Skip silently if:

  • ~/.coco/knowledge/ does not exist (knowledge engine not installed)
  • cron.py is unavailable or returns a non-zero exit code
  • The knowledge engine step takes more than 60 seconds (non-blocking)

Important Rules

  • Be thorough. Scan EVERY message. If someone was mentioned by name, they should be an entity. If something was decided, it should be a decision. If there's a next step, it should be a task.
  • Deduplicate. Check what already exists in the DB before proposing new writes. Use upsert_entity which matches on (project_id, type, name) or (project_id, type, external_id).
  • Date everything. Decisions and events need dates. Use today's date if the exact date isn't clear.
  • Attribute decisions. Record who decided, not just what was decided.
  • Link to threads. If a task, decision, or event belongs to an existing thread, link it.

Frequently asked questions

What does the Brain:Update AI skill do?

End-of-session brain flush. Scans the full conversation, extracts all new entities, decisions, tasks, events, relationships, and updates, presents a summary, and writes to project_brain.db after confirmation. Use at end of every session or when you want to capture everything discussed.

Why use Brain:Update on TypingMind?

Because you install it once and use it with any model. Brain:Update 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 Brain:Update in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/coco-research/coco/tree/main/systems/brain/skills/brain-update. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Brain:Update?

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 Brain:Update?

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

Is the Brain:Update AI skill free?

It is published on GitHub by coco-research. Check the repository for licensing terms. 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 👇