Skip to content
DApks-brainagentic-tooling

A wiki written by our AI brain

103 sessions about auth turned into an 84-line wiki page. 73 sessions about devcontainers got a summary I'd never have sat down to write. Four examples of what pks brain produces when you let it read half a year of your own work.

103 sessions about auth turned into an 84-line wiki page. I never wrote a word of it. The brain wrote it for me.

This is the 2nd post in the series about pks brain. The first post went through why the brain exists and how it's structured. This one opens the drawer and shows what it actually produces when I let it read half a year of Claude sessions. It isn't perfect — about 5% is outright wrong — but the rest is a wiki I'd otherwise never have had.

How a wiki page gets made

The wiki pipeline runs in four steps, each with its own pks brain command and its own checkpoint (a fifth phase, pks brain adr, sits outside the wiki pipeline — it gets its own post another time):

  1. ingest — deterministic dump of every session JSONL into compact firehoses (prompts.jsonl, tools.jsonl, files.jsonl, errors.jsonl)
  2. extract — AI-generated markdown summary per session, driven by an editable brain-extract skill
  3. synth — thematic clustering across sessions
  4. wiki — one page per detected cluster, synthesised from extracts and firehoses

My pks brain status says 7,000 prompts, 88,000 tool calls, and 2,940 AI extracts right now. Those extracts collapse into 436 wiki pages under .pks/brain/wiki/, one per detected theme. Here are four of them, picked because they demonstrate four different kinds of precision.

auth.md — 103 sessions condensed

The heaviest topic in my repo. The brain scanned 103 sessions that touched authentication and distilled them into 84 lines. It opens like this:

The Agentic Live authentication system orchestrates Keycloak (OIDC identity provider), NextAuth.js (browser session layer), and Graph API integration (Entra ID B2B guest management) to enable passwordless sign-in, federated OAuth (Microsoft, GitHub, LinkedIn), email-first guest invitations, and role-based access control.

That sentence appears nowhere in my code. No comment, no README, no ADR phrases it that way. The brain derived it from what I actually built across 103 sessions — it's synthesised, not stitched together.

It also pulled out user stories:

Email-first B2B guest onboarding — As a coworker from a partner tenant, I want to sign in with my email and be automatically invited as an Entra ID guest if I'm not in the tenant, so onboarding is instant without manual admin provisioning. From: 1c9f68e2-b33c.

Every user story has a source citation pointing to the session it was reconstructed from. Traceable AI synthesis. And — what almost no wiki has — a section called Open threads & known issues with concrete things still broken: "Keycloak resource lifecycle: Stop/start/restart commands fail in Aspire", "Session validation gap: User remains signed in after Keycloak reset". I'd never have written that into a wiki myself. But the brain could see the pattern across my sessions.

agentic-live.md — the big picture

34 sessions about the platform itself. The brain identifies the architecture as three layers — CLI, relay, viewer — and names the hot files: metadata/route.ts, lives/[streamId]/page.tsx, ws-relay.mjs. That kind of overview doesn't exist in any single commit, but after half a year on a project a model can pull it out — it sees where you edit most often and where you get stuck debugging.

One of the most useful items the brain found:

metadata/route.ts hotspot — 36 edits required due to complex fanout logic combining sessionId/broadcastId; needs refactoring or isolation.

That isn't gut feeling. That's 36 measured edits in one file. The brain can surface that kind of signal because it has the full tool-call history across every session — not just the most recent commit.

design-system.md — design too

One of the more surprising outputs. The brain hasn't only worked on code topics. It found 23 sessions about visual identity and synthesised them into a design-system page with palette, typography, tone, and component list:

Aesthetic: Dark, minimal, developer-grade. Inspired by Linear, Vercel, Raycast — but warmer and more human.

That's a phrasing I've used in conversations with Claude more than once. The brain pulled those repetitions together and canonised them into the design system's current defining line. That's the kind of consistency I wish I maintained myself — but I never get around to sitting down and writing it.

devcontainer.md — infrastructure too

73 sessions about devcontainers — how I spawn remote dev environments, which images I use, where it goes wrong. This is pure infrastructure, not features. It's also not the first thing I'd have chosen to document. But the brain wrote pages about it because the pattern was there: 73 sessions store more reusable decisions than most single-purpose features.

That's the point of automatic wiki generation: it documents what I did, not what I planned to document.

How accurate is it?

Honest answer: about 85% right, maybe 10% imprecise, 5% outright wrong. Examples of what I've seen:

The pattern: the brain is better at what was built and where it's broken than at why it was built. That makes sense — the source material is tool calls and prompts, not whiteboards.

I'm still surprised that devcontainer.md ended up one of the best pages. It's not something I'd ever have prioritised writing — and that might be the best summary of what the brain does: it prioritises by what I did, not by what I think sounds important.

This post has been revised 2 times — see full history
  1. Initial ai-draft. Title 'A wiki someone else wrote for me' missed the 'second brain' thread from the Karpathy reference in the intro post, and the 4-step pipeline was inline arrow-prose that wraps badly on mobile.

  2. Title now anchors the series' 'second brain' thread from the Karpathy reference. The 4-step pipeline renders as a numbered list instead of inline arrow-prose that wraps badly on mobile.

  3. Mirrors the Danish v2: number-first opening (103 sessions / 84 lines), accuracy teaser (5% outright wrong) moved into the intro, editorial signposts dropped, and the hand-written 'Next post' section replaced with a closing observation — series_footer owns the next-link.