agentleFS
herreraspaintingba-hubherreraspaintingba-hub/second-brain-starter-kit/skills/brain-search/SKILL.md

brain-search

Skill0 starsChanged 42 days agoMITView on GitHub

Searches the user's second brain (their Obsidian vault) BEFORE answering or asking, with a local full-text index ranked by relevance. Use it whenever the answer might already be in the vault: "what did we decide about X?", "where did we leave Y?", "have we done this before?", "find my notes on Z", "search my brain", "¿qué decidimos sobre X?", "¿dónde quedó Y?", "¿ya hicimos esto?", "busca en mi cerebro", and also on your own initiative before asking the user for a fact (a name, a number, a past choice) that the vault may hold. Bilingual EN+ES.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only then, ask the user. If they answer with a durable fact, offer to save it.

    line 26
  2. Distinctive:

    If nothing has every word, it retries with any of them and says so.

    line 51
  3. Very specific:

    If python3 is not available (or the index cannot be built), fall back to a plain text search of the vault with the host's file search …

    line 87
  4. Distinctive:

    Read the top 1 to 3 notes before answering.

    line 98
  5. Distinctive:

    If two notes disagree, say so and show both, newest first.

    line 99
  6. Distinctive:

    If nothing is found, say it plainly ("nothing in the brain about X"), then ask.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Brain Search: look in the brain before you ask

The rule: retrieval first

A fact about the user's life or work (a decision, a price, a person, a date, how something was done) is searched before it is asked. The order:

  1. brain_search.py (this skill).
  2. The project Door, if the question is about a project (project-door).
  3. A plain text search of the vault, for an exact number or phrase.
  4. Only then, ask the user. If they answer with a durable fact, offer to save it.

Asking the user something their own brain already knows wastes their time and teaches them the brain is not worth feeding.


How it works

The kit keeps a search index of the whole vault at {{VAULT_PATH}}/.brain/brain.sqlite (SQLite FTS5, built with only the Python standard library). It ranks by relevance (bm25): a word in the title, description, aliases or tags weighs more than the same word in the body. Accents do not matter.

T="{{VAULT_PATH}}/.brain/tools"
python3 "$T/brain_search.py" "raised beds"                       # every word must appear
python3 "$T/brain_search.py" "\"raised beds\""                   # exact phrase
python3 "$T/brain_search.py" compost --prefix                    # compost* (composting, composts)
python3 "$T/brain_search.py" budget --type decision --sort date  # newest decision first
python3 "$T/brain_search.py" garden --folder "06 Session Logs" --since 2026-09-01
python3 "$T/brain_search.py" "pricing" --project kitchen --limit 5
python3 "$T/brain_search.py" roof --json                         # for further processing

If nothing has every word, it retries with any of them and says so.

Recipes

The user asksRun
"What did we decide about X?"--title "X" --type decision --sort date (newest first; if empty, drop --title)
"Where did we leave project Y?"project-door first; then "Y" --folder "06 Session Logs" --sort date
"Have we done this before?"the 2 or 3 key words, then --type session,lesson
"What do I know about person Z?""Z" --type person, then without the filter
"Find that article about W""W" --type reference

Filters

--type, --project, --folder, --status, --not-folder, --title, --tag, --since, --until, --limit, --sort rank|date, --prefix, --raw (FTS5 syntax as is, e.g. title:budget, NEAR(a b)). Filters are case-insensitive substring matches and accept a comma list.


Keeping the index fresh

The index is rebuilt in seconds, whole, every time:

python3 "{{VAULT_PATH}}/.brain/tools/brain_index.py"

It runs at the end of save-to-obsidian and close-session, and every month with the health check. If a search says the index is more than 24 hours old, rebuild it first.


Without Python

If python3 is not available (or the index cannot be built), fall back to a plain text search of the vault with the host's file search (Grep/Glob, or grep -ril "word"), starting with file names and the description: lines, then the bodies. Same order, less ranking.


How to answer

  • Answer from what the notes say, and name the note each fact came from as a [[link]], so the user can open it.
  • Read the top 1 to 3 notes before answering; the snippet is a pointer, not the answer.
  • If two notes disagree, say so and show both, newest first. Do not pick one silently.
  • If nothing is found, say it plainly ("nothing in the brain about X"), then ask.
  • Show the work in one line: "Searched the brain for X: 3 notes, used the first two."

Changelog

  • 2.0.0 (2026-10-02): New skill. Local FTS5 index, retrieval-first rule, recipes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.