sources/wiki split, truth-timeline page structure, and MCP server#11
Closed
kelsi-bizer wants to merge 1 commit into
Closed
sources/wiki split, truth-timeline page structure, and MCP server#11kelsi-bizer wants to merge 1 commit into
kelsi-bizer wants to merge 1 commit into
Conversation
Brings two cross-cutting patterns into BizerOS Knowledge that have been
proven elsewhere (Karpathy's LLM Wiki pattern, GBrain's compiled-truth
structure) and adds a Model Context Protocol server so the brain works
with any MCP-capable agent, not only those that load .agents/skills/.
1. Folder convention: sources/, pages/, daily/
The SKILL.md now teaches three distinct folders:
- sources/ raw, immutable inputs (transcripts, articles, email
dumps). Agent treats as append-only.
- pages/ the wiki: synthesized topical/per-entity notes the agent
owns and maintains.
- daily/ the user's journal, mutable by the human.
The agent's procedures are split accordingly: "Capturing from a
conversation" updates daily/; a new "Ingesting a source" procedure
files raw input under sources/ and links it back to pages/.
2. Page structure: compiled truth + timeline
Every pages/<Entity>.md now has a stable, rewritable "compiled truth"
section above a "---" separator and an append-only "## Timeline"
below, with dated entries that back-link to [[daily/...]] or
[[sources/...]]. The truth section is overwritten when facts change;
timeline entries are never edited or removed. The user gets the
current understanding AND the provenance trail in one file.
Pitfalls added: never rewrite sources/, never delete timeline
entries, never edit existing timeline entries.
3. MCP server (packages/mcp-server)
New package exposing the same four tools (list_notes, search_notes,
read_note, write_note) over the Model Context Protocol via stdio.
Agents that speak MCP natively (Claude Code, Cursor, any MCP client)
can use BizerOS Knowledge by adding one line to their MCP config:
{
"mcpServers": {
"bizeros-knowledge": {
"command": "node",
"args": ["/opt/bizeros-knowledge/packages/mcp-server/src/server.js"],
"env": { "BRAIN_DIR": "/srv/bizeros/brain" }
}
}
}
Implementation:
- src/brain.js filesystem ops with the same safety contract as
brain_tools.py: path traversal blocked, atomic
writes (tmp + rename), consistent {ok, ...} shape.
- src/server.js MCP Server wired to StdioServerTransport. Tool
schemas mirror the JSON Schema in tools/definitions.
json but include the truth-timeline guidance in the
write_note description.
Tests (18 passing, node:test):
- brain.test.js round-trip, ensureMd, traversal blocked, null byte
rejected, search snippet correctness, list sorted.
- server.test.js list_tools exposes all four with schemas, call_tool
round-trips, unknown tool name handled, traversal
rejected at the protocol layer.
End-to-end stdio smoke test confirmed: real MCP client sequence
(initialize -> tools/list -> tools/call) returns valid JSON-RPC
responses and writes a file to BRAIN_DIR.
No code changes outside .agents/skills/bizeros-knowledge/SKILL.md
and packages/mcp-server/. The web UI (packages/notes-app), file-api
(packages/file-api), and docker image are unaffected.
4 tasks
kelsi-bizer
added a commit
that referenced
this pull request
May 11, 2026
Renames the product across every surface that ships to a user — the SPA, the file-api, the agent skill, the docker image tag, and default paths. Doesn't touch the upstream-Logseq files (those will be deleted by PR #10) or the README (likewise rewritten by PR #10). Why now: BizerBrain is shorter, matches the /brain folder we already use everywhere, and sits in the same naming family as GBrain (deliberate positioning, not derivative). This is the earliest moment to rename — image hasn't been pulled in production, ClawHub hasn't been submitted, no external references exist yet. Surface changes: - Skill folder: .agents/skills/bizeros-knowledge -> bizerbrain (renamed via git mv, history preserved) - SKILL.md frontmatter: name=bizerbrain, tags includes bizerbrain - SKILL.md body heading: # BizerBrain - SKILL.md default path: /srv/bizeros/brain -> /srv/bizerbrain/brain - brain_tools.py: docstring + default BRAIN_DIR - packages/notes-app/index.html: <title>BizerBrain</title> - packages/notes-app/src/App.tsx: app-title text + localStorage key (bizeros-view-mode -> bizerbrain-view-mode) - packages/notes-app/src/hooks/useTheme.ts: localStorage key (bizeros-theme -> bizerbrain-theme) - packages/notes-app/package.json: name -> @bizerbrain/notes-app - packages/file-api/package.json: name -> @bizerbrain/file-api - docker/entrypoint.sh: header comment - .github/workflows/build-docker.yml: IMAGE_NAME -> bizerbrain (image now publishes to ghcr.io/<owner>/bizerbrain:latest) Verified: - packages/notes-app: pnpm typecheck passes with new package name - packages/file-api: pnpm test passes (20/20) - grep "BizerOS\|bizeros" returns zero hits in our owned files Not in this PR: - Repo rename on GitHub (UI action, owner does it whenever; the image path is already on the new name regardless) - README.md (still upstream Logseq content; PR #10 rewrites) - LICENSE (added by PR #10) - Open PRs #10 and #11 will need a small rebase to use the new name (mostly the SKILL.md and package.json identifiers) Co-authored-by: Claude <noreply@anthropic.com>
kelsi-bizer
added a commit
that referenced
this pull request
May 11, 2026
…#14) Redo of closed PR #11 with BizerBrain naming throughout. Brings two cross-cutting patterns into BizerBrain that have been proven elsewhere (Karpathy's LLM Wiki pattern, GBrain's compiled-truth structure) and adds a Model Context Protocol server so the brain works with any MCP-capable agent. 1. Folder convention: sources/, pages/, daily/ The SKILL.md now teaches three distinct folders: - sources/ raw, immutable inputs (transcripts, articles, email dumps). Agent treats as append-only. - pages/ the wiki: synthesized topical/per-entity notes the agent owns and maintains. - daily/ the user's journal, mutable by the human. A new "Ingesting a source" procedure files raw input under sources/ and links it back to pages/. The boundary: sources/ is the receipts, pages/ is the synthesis, daily/ is the human's voice. 2. Page structure: compiled truth + timeline Every pages/<Entity>.md now has a stable, rewritable "compiled truth" section above a "---" separator and an append-only "## Timeline" below, with dated entries that back-link to [[daily/...]] or [[sources/...]]. The truth section is overwritten when facts change; timeline entries are never edited or removed. Pitfalls added: never rewrite sources/, never delete timeline entries, never edit existing timeline entries. 3. MCP server (packages/mcp-server) New package exposing the same four tools (list_notes, search_notes, read_note, write_note) over the Model Context Protocol via stdio. Agents that speak MCP natively (Claude Code, Cursor, any MCP client) can use BizerBrain by adding one line to their MCP config: { "mcpServers": { "bizerbrain": { "command": "node", "args": ["/opt/bizerbrain/packages/mcp-server/src/server.js"], "env": { "BRAIN_DIR": "/srv/bizerbrain/brain" } } } } Implementation: - src/brain.js filesystem ops with the same safety contract as brain_tools.py: path traversal blocked, atomic writes (tmp + rename), consistent {ok, ...} shape. - src/server.js MCP Server wired to StdioServerTransport. Tool schemas include the truth-timeline guidance in the write_note description so MCP-only agents (which don't load SKILL.md) get the same convention. Tests (17 passing, node:test): - brain.test.js round-trip, ensureMd, traversal blocked, null byte rejected, search snippet correctness, list sorted. - server.test.js list_tools exposes all four with schemas, call_tool round-trips, unknown tool name handled, traversal rejected at the protocol layer. No code changes outside .agents/skills/bizerbrain/SKILL.md and packages/mcp-server/. The web UI (packages/notes-app), file-api (packages/file-api), and docker image are unaffected. Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three concrete patterns borrowed from the GBrain and Karpathy-pattern comparisons we discussed, all within BizerOS Knowledge's filesystem-pure philosophy:
sources/vspages/vsdaily/folder split (Karpathy-inspired).agents/skills/Nothing in here adds a database, an embedding pipeline, or any external dependency. The brain is still a folder of plain
.mdfiles; the new patterns just make the convention sharper and the agent surface broader.1. Folder convention update —
.agents/skills/bizeros-knowledge/SKILL.mdThe skill now teaches three distinct folders with three distinct jobs:
sources/pages/daily/The boundary that matters most:
sources/is the receipts,pages/is the synthesis,daily/is the human's voice. The agent's procedures are now split accordingly — "Capturing from a conversation" updatesdaily/; a new "Ingesting a source" procedure files raw input undersources/and links it back to the relevantpages/.2. Page structure — compiled truth + timeline
Every
pages/<Entity>.mdnow follows:The compiled truth above the
---is rewritable — the agent keeps it current as facts evolve. The timeline below is append-only — every meaningful piece of evidence gets a new dated entry with a back-link to where it came from. Never edited, never deleted.This solves a real problem with pure-markdown knowledge bases: provenance. When the agent says "Sarah lives in Berlin," the user can scroll down and see which raw note that came from and when. Without this convention, the agent either hallucinates or gets stuck in conservative "I'm not sure" mode.
New pitfalls in the skill: never rewrite
sources/, never delete or edit timeline entries.3. MCP server —
packages/mcp-serverNew package exposing the same four tools (
list_notes,search_notes,read_note,write_note) over the Model Context Protocol via stdio.Why this matters: agentskills.io skills work great in Hermes, OpenClaw, and Claude Code, but MCP is the broader, more portable standard. Adding an MCP server makes BizerOS Knowledge usable from any MCP-capable agent — Claude Code, Cursor, MCP-Inspector, custom clients — by adding one line to their MCP config:
{ "mcpServers": { "bizeros-knowledge": { "command": "node", "args": ["/opt/bizeros-knowledge/packages/mcp-server/src/server.js"], "env": { "BRAIN_DIR": "/srv/bizeros/brain" } } } }Implementation
src/brain.jsmirrors the same safety contract asbrain_tools.py: path traversal blocked viapath.relative()check, null bytes rejected, atomic writes (tmp + rename), consistent{ok, ...}return shape.Tool descriptions in
server.jscarry the new conventions through to the agent — thewrite_notedescription explicitly mentions the compiled-truth + timeline structure so MCP-only agents (which don't load the SKILL.md) get the same guidance.Tests
18 passing (
node --test test/*.test.js):.mdauto-append, traversal blocked, null byte rejected, search returns first matching line as snippet, list sorted alphabetically.tools/listexposes all four tools with full schemas;tools/callround-trips read+write; unknown tool names handled; traversal rejected at the protocol boundary too.End-to-end MCP stdio smoke test (passed)
Drove the server with a real JSON-RPC sequence:
initialize→ server announces capabilitiestools/list→ all 4 tools with descriptions and JSON Schematools/call write_note→{"ok":true,"path":"pages/Hello.md","bytes":19}cat /tmp/brain-mcp-live/pages/Hello.md→ exact contentWhat's not touched
packages/notes-app— web UI unchanged.packages/file-api— HTTP file service unchanged.Test plan
cd packages/mcp-server && pnpm install && pnpm test— 18 tests passlist_notesvia the MCP server and return the contents of$BRAIN_DIRdaily/<today>.mdwith[[wiki links]]and create/update relevantpages/<Entity>.mdfiles following the truth + timeline patternsources/2026-05-XX <topic>.md→ agent extracts entities, links frompages/<Entity>.mdtimelines back to[[sources/2026-05-XX <topic>]]Generated by Claude Code