Agent skill

Braindb Agent

by dimknaf in dimknaf/braindb

Persistent memory across sessions via the BrainDB agent. An agent skill from dimknaf/braindb.

Apache-2.0Auto-check: notesAgent Workflows

Install Braindb Agent

skills CLI
$ npx skills add dimknaf/braindb --skill braindb-agent -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dimknaf/braindb braindb-agent --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dimknaf/braindb.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/braindb-agent .claude/skills/braindb-agent && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
braindb-agent
GitHub stars
110
Token cost
~3.2k tokens
SKILL.md length
1,611 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Persistent memory across sessions via the BrainDB agent. An agent skill from dimknaf/braindb.

  • Works in 6 steps: Ask the user: "BrainDB isn't running. Do… → Find the braindb repo — look for a… → Start it: cd && docker compose up -d → …
  • Tasks that involve Agent memory
  • SKILL.md covers BrainDB Memory Agent, TOOL PRIORITY (read this first), RECALL — at conversation… and SAVE — after learning…, plus 5 more sections
  • Calls curl and docker

What it does

Braindb Agent is an agent skill from dimknaf/braindb. Persistent memory across sessions via the BrainDB agent. Use at conversation start and whenever you need to recall what you know about the user or save new information to long-term memory.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent memory and LLM wikis. The repository describes itself as: An "LLM wiki" upgraded to a real database — typed entities, graph relations, HTTP API, and a built-in natural-language agent. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Agent memory
  • Tasks that involve LLM wikis

Example prompts

  • “/braindb-agent”

Requirements

  • Docker
  • Pre-approved tools (allowed-tools): Bash, Read

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Ask the user: "BrainDB isn't running. Do you want me to start it for you?"
  2. Find the braindb repo — look for a directory that has ALL of these
  3. Start it: cd && docker compose up -d
  4. Cache the path: echo "" > ~/.claude/skills/braindb-agent/.repo_path
  5. Wait for it: poll curl -sf http://localhost:8000/health for up to 30 seconds.
  6. If healthy, proceed. If the user declines or start fails, proceed WITHOUT memory.

What it can do on your machine

Read from SKILL.md and the folder at commit 99cd121. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl and docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Braindb Agent loads about 3.2k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 1,611 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:227
    et `AGENT_VERBOSE=true` in the server's `.env` (default is `false`). When enabled, every tool call the agent makes is lo
  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dimknaf/braindb at commit 99cd121, republished under its Apache-2.0 licence (© dimknaf). 1,611 words, ~3,216 tokens.

Download SKILL.mdSave it as .claude/skills/braindb-agent/SKILL.md (or your agent's skills folder).
name
braindb-agent
description
Persistent memory across sessions via the BrainDB agent. Use at conversation start and whenever you need to recall what you know about the user or save new information to long-term memory.
allowed-tools
Bash, Read

BrainDB Memory Agent

BrainDB has its own internal agent (LiteLLM with pluggable provider via LLM_PROFILE; defaults to deepinfra/google/gemma-4-31B-it) that handles all memory operations. You don't call individual endpoints — you ask the agent in plain English via one endpoint: POST http://localhost:8000/api/v1/agent/query.

Health check:

!curl -sf http://localhost:8000/health > /dev/null 2>&1 && echo "OK" || echo "BRAINDB_DOWN"

If the output contains BRAINDB_DOWN, the memory database is not running. Do this:

  1. Ask the user: "BrainDB isn't running. Do you want me to start it for you?"
  2. Find the braindb repo — look for a directory that has ALL of these:
    • docker-compose.yml at the root
    • braindb/main.py
    • pyproject.toml with name = "braindb" Search in: current dir, parent dirs (up to 3 levels), common locations like ~/source/repos/**/braindb/.
  3. Start it: cd <braindb-path> && docker compose up -d
  4. Cache the path: echo "<braindb-path>" > ~/.claude/skills/braindb-agent/.repo_path
  5. Wait for it: poll curl -sf http://localhost:8000/health for up to 30 seconds.
  6. If healthy, proceed. If the user declines or start fails, proceed WITHOUT memory.

TOOL PRIORITY (read this first)

The agent has a clear order of tools it should reach for. When you phrase a request, lean into the sophisticated tools — don't ask it to "run SQL" for anything to do with recall or understanding.

  1. Query-driven recall — "what do we know about X?" → the agent calls /memory/context (keyword-mediated fuzzy + embedding + graph + ranking, with diversity quotas). The default for ALL discovery and understanding.
  2. Entity-driven neighbourhood — the agent's view_tree returns a nested JSON tree (root keyed by entity_type, children arrays per node, 1-N hops out, keyword + retired-wiki noise filtered by default, _truncated marker if more remain). Especially useful when an entity ID is already in hand — often sharper than another query about the same entity. On hub entities pass max_depth=3 for narrative chains.
  3. Multi-step investigation — "investigate / disambiguate / resolve X" → the agent delegates to a subagent. Keeps the main context clean.
  4. Direct lookups — view_entity_relations, get_entity, list_entities for narrow questions.
  5. search_sql ⚠ exception only — for explicit aggregates (counts, GROUP BY, activity-log joins). Never for finding / understanding / "what's related to" — those are jobs for the tools above.

If you're tempted to phrase a request as "run a SQL query that finds…" for finding or understanding something, stop — that's the recall or tree path's job. Ask in plain English.

Wikis are first-class memory entities curated by an internal maintainer + writer pipeline. The agent surfaces them through recall automatically when relevant — you don't have to ask for them explicitly, and you don't have to trigger anything to make new ones. Saving facts with the right keywords is enough; the scheduler runs maintain → write on its 60s tick and the wikis materialise on their own.

Internally the agent now researches from short previews and reads a full body only by id (paging large ones, or delegating big documents to a subagent), so its context stays clean — just ask in natural language ("read and summarise datasource X"); it handles the chunking itself.

RECALL — at conversation start, and whenever you need context

Ask the agent in natural language. It handles keyword formulation, multi-query search, graph traversal, and summarization.

Encoding note: When constructing the curl JSON body, use ASCII characters only — plain hyphens (-), straight quotes (", '), no em-dashes (—) or smart quotes. On Windows shells these get mangled in the JSON body and the server returns 400 Bad Request.

bash
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"Tell me who the user is - role, expertise, preferences, recent projects."}'

For topic-specific recall:

bash
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"What do you know about the user React frontend experience?"}'

Read the answer field from the response. Use the summary to inform your response. Never paste raw JSON into the conversation.


SAVE — after learning something new

Describe what you learned in natural language. The agent decides the entity type, picks keywords, generates embeddings, creates relations.

bash
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"Save: the user just told me they prefer simple code over abstractions. Source: user-stated. Connect to existing preference entities."}'
Proactive save — but ASK the user first

The pattern is RECALL → ASK → SAVE:

  1. When the user shares something that might be worth remembering (a name, role, project, preference, decision, your own inference about them), RECALL first via the agent to check if it's already known.

  2. If it's net-new, ASK the user:

    "I haven't seen this before — should I save it to BrainDB? I'd file it as a [fact / thought / rule] tagged with [keywords]."

  3. Only on a 'yes', issue the save request to the agent.

Don't pre-save without confirmation. The user has the final say on what becomes long-term memory. User-confirmed memory is higher-signal and lets the user catch judgement-call mistakes early.

Exception: when the user explicitly framed it as a rule ("from now on, always X"; "never do Y"), save it without an extra confirmation — they already said it — but surface the action: "Saving that as a rule."

What's worth flagging to the user
  • Identity / role / company (one-time setup info)
  • Strong preferences or working-style rules
  • Project / topic context the user just disclosed
  • Decisions the user explicitly made
  • Useful URLs or references the user shared
  • Your own inferences about the user (tag as thought, source=agent-inference) — ASK before persisting these too; an inference is still memory.

The goal is to capture what the user gives you in conversation that isn't already in BrainDB — not to scrape every utterance. Information already in recall doesn't need saving again; ephemeral task details ("currently debugging X") don't need saving at all.


Example queries

Recall (no confirmation needed — these are reads)
SituationQuery to send to the agent
Start of conversation"Tell me who the user is - role, expertise, preferences, recent projects."
User mentions a topic"What do you know about the user ML experience and AI projects?"
User asks about past work"What has the user shipped recently? Check facts with source=user-stated from the last month."
Need to find duplicates"Find near-duplicate entities in memory."
Explore the graph"What are the densest topics in memory? Which entities have the most connections?"
Show full SKILL.md (679 more words)Show less
Save (RECALL → ASK → SAVE — only send the agent query after the user confirms)
SituationWhat Claude says to the user firstWhat Claude sends to the agent (on a 'yes')
User mentions something net-new"I noticed you just said you're working on the IR pipeline multilingual extraction — that looks worth saving. Should I?""Save: user is working on the IR pipeline multilingual extraction. Connect to existing IR entities."
User shares a preference"Should I save that as a long-term preference?""Save as fact: user prefers simple code over abstractions. Source: user-stated. Keywords: user-preference, code-style."
User explicitly states a rule(no confirmation — they framed it as a rule) "Saving that as a rule.""Save as rule: always prefer simple code over abstractions. Source: user-stated. Category: behavior."
You drew an inference about the user"I'm getting the sense you're senior in ML — should I save that as a thought?""Save as thought: user appears senior in ML based on the depth of their question. Source: agent-inference. Certainty: 0.6."

Delegation — ask the agent to spawn a subagent for focused work

To keep the agent's main context clean and your conversation uncluttered, you can explicitly tell it to delegate heavy tasks. Just include "use a subagent" or "delegate this" in the query — the agent has a delegate_to_subagent tool that runs a fresh agent instance in its own context and returns only a summary.

When to delegate
  • Deep searches or graph exploration
  • Duplicate detection, orphan cleanup, bulk relation work
  • Any task that would produce a lot of intermediate tool output
Examples
bash
# Find duplicates without seeing intermediate results
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"Delegate to a subagent: find near-duplicate facts and return top 10 pairs with their IDs."}'

# Deep search on a topic
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"Use a subagent: explore every entity tagged with investor-relations and return a clean summary of what is there."}'

# Create relations in bulk
curl -s -X POST http://localhost:8000/api/v1/agent/query \
  -H "Content-Type: application/json" \
  -d '{"query":"Spawn a subagent: find orphaned user-profile facts and create tagged_with links to relevant keyword entities."}'

Delegation is 1 level deep — subagents cannot spawn more subagents.


File ingestion — automatic, no agent call needed

If the user wants a local file (article, transcript, note, document) ingested into BrainDB, don't ask the agent to do it. Instead, copy the file into the repo's data/sources/ directory and the system handles the rest:

  1. The braindb_watcher sidecar polls data/sources/ every ~7 seconds.
  2. New files are auto-ingested as datasource entities (content + hash + word count).
  3. The watcher then runs an agent-driven extraction pass that creates one or more fact entities derived from the document and links them back via derived_from relations.
  4. On success the file is moved to data/sources/ingested/; on failure to data/sources/failed/ with a sidecar .error.txt.

What this means for you (Claude) and the user:

  • Tell the user: "Just drop the file into data/sources/ on the BrainDB repo. The watcher will pick it up within a few seconds and you'll see the facts appear in recall a minute or two later."
  • Do not issue an /agent/query like "Save this file..." with the file contents pasted into the prompt — that bloats the LLM context and bypasses the proper extraction pipeline. The watcher path produces structured facts + derived_from relations + keyword auto-tagging; pasting bypasses all of it.
  • Watch progress if you want to confirm completion:
bash
docker logs braindb_watcher -f

You'll see ingested NEW: <filename> -> <id> words=N then later extraction complete for <id>: N facts total. After that the new facts surface naturally in /agent/query recall — no extra steps.

Edge cases:

  • Very large files are chunked automatically; extraction takes proportionally longer (typically 60-180 seconds per chunk on local Qwen, faster on deepinfra).
  • If a file ends up in data/sources/failed/, read the sidecar .error.txt next to it to see what went wrong.
  • The watcher dedupes by file content hash, so re-dropping the same file won't re-extract.

Verbose mode — watch the agent work in real time

Set AGENT_VERBOSE=true in the server's .env (default is false). When enabled, every tool call the agent makes is logged to stdout with args and result preview. Watch it live:

bash
docker logs braindb_api -f

The HTTP response itself is unchanged (just {"answer": "..."}). Logs go to the server stdout only — clean separation between the response payload and operational logging.


Error handling

  • If the agent call fails (connection refused, 500, timeout): proceed WITHOUT memory. Don't retry, don't block the conversation.
  • If the answer mentions an ERROR: the agent tried but some tool failed. Carry on — use whatever partial information came back.
  • Agent calls can take up to 10 minutes if the LLM provider is slow. Add --max-time 600 to long curl calls.

© dimknaf, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/braindb-agent of dimknaf/braindb.

Open the folder on GitHubat commit 99cd121

Compare with similar skills

Braindb Agent next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Braindb Agent compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Braindb Agent this skilldimknaf/braindb110—~3.2kAutomated safety check: NotesApache-2.0
AI Project Memorytudoumashu/ai-memory-skillpack411—~1.1kAutomated safety check: PassMIT
LLM WikiYeachan-Heo/oh-my-claudecode40k—~721Automated safety check: PassMIT
Agent Wiki Guideline ExtractorAgentToolkit/altk-evolve122—~2kAutomated safety check: PassApache-2.0
Swarmvaultswarmclawai/swarmvault708—~6.1kAutomated safety check: PassMIT
MemPalace Memory SearchMemPalace/mempalace59k—~1.4kAutomated safety check: PassMIT

Similar skills

  • AI Project Memory

    tudoumashu/ai-memory-skillpack

    Maintain bounded, durable AI project memory in a repository's docs/ai/ pack.

    411 GitHub stars~1.1k tokensUpdated 29 days ago
    Agent WorkflowsAuto-check passed
  • LLM Wiki

    Yeachan-Heo/oh-my-claudecode

    Keeps a persistent markdown wiki of project and session knowledge that the agent can ingest into, query, lint and read across sessions.

    40k GitHub stars~721 tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Agent Wiki Guideline Extractor

    AgentToolkit/altk-evolve

    Reads a normalized Claude Code trajectory JSON and turns its errors and solutions into reusable guideline pages in wiki-twobatch/guidelines.

    122 GitHub stars~2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Swarmvault

    swarmclawai/swarmvault

    Use SwarmVault when the user needs a local-first knowledge vault that writes durable markdown, graph, search, dashboard, review, chat-session, context-pack, task-ledger, static AI export, retrieval…

    708 GitHub stars~6.1k tokensUpdated 3 mo ago
    Knowledge ManagementAuto-check passed
  • MemPalace Memory Search

    MemPalace/mempalace

    Mines project files and conversation exports into a local, searchable memory palace and recalls past work by semantic search through the mempalace CLI.

    59k GitHub stars~1.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Installs and configures MemPalace as a private local palace, a shared-brain hub or a client of an existing hub, including MCP registration and version-correct initialization.

    59k GitHub stars~2.2k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from dimknaf/braindb

  • Braindb Custom Profile

    dimknaf/braindb

    How to author a BrainDB custom profile — prompt add/replace fragments and an optional keyless ingestor — that shapes wiki naming/structure and feeds a custom ingestion source, with zero effect on…

    110 GitHub stars~1.6k tokensUpdated 25 days ago
    Auto-check: notes
  • Braindb

    dimknaf/braindb

    Memory recall and save. An agent skill from dimknaf/braindb.

    110 GitHub stars~6.1k tokensUpdated 25 days ago
    Auto-check: notes

Questions about Braindb Agent

What does Braindb Agent do?

Persistent memory across sessions via the BrainDB agent. An agent skill from dimknaf/braindb. Braindb Agent is an agent skill from dimknaf/braindb. Persistent memory across sessions via the BrainDB agent.

When should I use Braindb Agent?

Braindb Agent fits situations like: tasks that involve Agent memory; tasks that involve LLM wikis.

How do I install Braindb Agent in Claude Code?

Run `npx skills add dimknaf/braindb --skill braindb-agent -a claude-code`. Or copy the skill folder (skills/braindb-agent in dimknaf/braindb) into .claude/skills/braindb-agent in your project. Claude Code loads it when a task matches its description.

How do I install Braindb Agent in Codex?

Run `npx skills add dimknaf/braindb --skill braindb-agent -a codex`. Or copy the skill folder (skills/braindb-agent in dimknaf/braindb) into .agents/skills/braindb-agent in your project. Codex loads it when a task matches its description.

Can I use Braindb Agent in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dimknaf/braindb --skill braindb-agent -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/braindb-agent, .gemini/skills/braindb-agent, .github/skills/braindb-agent and .opencode/skills/braindb-agent in your project.

What does Braindb Agent need to run?

Going by SKILL.md and its folder, Braindb Agent needs the command-line tools its instructions call (curl and docker). Our summary lists: Docker. Its frontmatter pre-approves these tools: Bash, Read.

Does Braindb Agent access the network?

SKILL.md contains no URLs. Its commands use curl and docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Braindb Agent safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file; pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Braindb Agent use?

Braindb Agent is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Braindb Agent use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Braindb Agent?

Skills that share tags, products or a category with Braindb Agent: AI Project Memory (tudoumashu/ai-memory-skillpack, 411 stars), LLM Wiki (Yeachan-Heo/oh-my-claudecode, 40k stars), Agent Wiki Guideline Extractor (AgentToolkit/altk-evolve, 122 stars) and Swarmvault (swarmclawai/swarmvault, 708 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Braindb Agent?

dimknaf (a GitHub user) maintains it in dimknaf/braindb, which has 110 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 12, 2026.

Source: dimknaf/braindb on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.