Building a Second Brain · Qwen

Two Brains, One Operator

Why personal and corporate agent memory must split, how each half is governed, and how Qwen 3.8 Max and Qwen 3.8 Flash Next on two DGX Sparks planned the architecture and audited 1,837 pages of company knowledge.

Jensen Loke · September 2026 · Revised 22 Sep 2026 · ~15 min read

Public note: this paper describes a real production system but uses generalized names and omits live values, page identifiers, customer identities, hostnames, and credentials. Finding classes and counts are real; the specifics are deliberately not.

Abstract

When AI agents become coworkers, memory becomes infrastructure. I run two agent platforms - a personal platform (Hermes) and a company platform (OpenClaw) - and both need durable memory. The fork: share one knowledge brain, or split it. I argue the split is not organisational tidiness but a security and governance requirement: the two brains have different writer populations, different subjects, and different costs of being wrong.

I describe both halves. The company brain is one shared source with server-enforced write fences per agent - an agent can only write inside its own prefixes, a frozen archive is searchable and labelled historical, and I approve clients and handle exceptions. It was audited by a local-model verifier loop that swept 1,837 pages and surfaced real credential leaks. The personal brain plays a different role: a universal harness adapter that serves skills, harness configuration, and a device framework to any agent harness on any device. Both halves were built with Qwen: Qwen 3.8 Max for architecture and policy design, and Qwen 3.8 Flash Next served from two NVIDIA DGX Sparks for the high-volume audit. Revision notes at the end record the earlier human-gated design and why I replaced it; Section 6 credits the tools - Qwen, Devin, Codex - that built each part.

1. One Operator, Two Platforms

I am the operator in the title. I run two agent platforms, each with its own fleet, and I owe each fleet a durable memory.

Hermes - the personal platform

A chief-of-staff agent coordinates specialist agents - calendar, tasks, contacts, investments, per-client scopes - as private peers on loopback. Subject matter is one person. Memory must be permissive: a personal assistant that needs an approval queue for every note is useless.

OpenClaw - the company platform

Several enrolled agents - support, engineering, synthesis, verification - plus humans, all writing about customers, tickets, products, and credentials. A wrong or leaked page can harm people outside the building. Memory must be governed: every agent writes only inside a fence the server enforces, and Git history is the audit trail.

Both fleets need the same mechanical thing - a knowledge base behind MCP that agents can search, read, and write - but they need it to behave in opposite ways. That tension is what this paper is about.

2. Why One Brain Fails

The naive design is one brain with folders. It fails because personal memory and company memory have different trust physics.

Property Personal brain Company brain
Writer population One owner plus personal agents under the owner's direct control. Multiple enrolled agents with their own credentials, plus humans.
Subject matter The owner's own life. No third parties. Customers, staff, products, credentials - other people's data.
Cost of being wrong The owner misremembers something. Recoverable. A customer is misinformed or a credential leaks. External harm.
Promotion model Self-promoting. Write it, it is true for you. Fenced. Agents write directly, but only where the server lets them; every write is a revision in Git.
Failure containment Git-backed, single-owner, trivially reversible. Needs enforced boundaries, audit trails, and scrubbing.

Three consequences follow.

1 · Governance asymmetry

One shared brain must pick a governance level. Pick the company's and personal memory drowns in gates it never needed. Pick the personal one and an agent can launder a hallucination into company truth.

2 · Credential isolation

Company knowledge requires company credentials. Share one brain and some personal agent ends up holding company keys. The split makes isolation physical: separate servers, separate credentials, neither side a fallback. Inside my own fleet, company-brain access sits with a single named specialist.

3 · Blast radius

A company brain accumulates imports: old manuals, handover documents, ticket archives. Some contain secrets nobody remembers copying. One bad import in a shared store contaminates what I personally trust too.

The split is the architecture: two GBrain servers, one per trust domain, each reached over MCP with its own credential. Sections 3 and 5 describe each half.

3. The Company Brain: Fences, Not Gates

The company half must solve one problem above all others: many writers, most of them models, and no reviewer with time to read them all.

One engine - stock upstream GBrain 0.51 with its managed writer - serves three sources. One shared company source, ~750 pages: the shared documentation folders (decisions, standards, domain, platform, runbooks, incidents, sources) plus a products/<product>/ folder per registered product and an agents/<agent>/ folder per writer. A frozen archive source holds ~1,160 historical imports - searchable, read-only, every hit labelled historical. A restricted internal source sits empty with no grants, created so restricted material has a home the agents cannot see.

Every writer is a fenced client. Each agent's credential - an OAuth client I approve once in the admin page - carries a server-enforced list of write prefixes: its own agents/<name>/ folder plus products/. A write outside the fence returns permission-denied from the server; I verified that live, it is not policy prose. Reads span the shared source and the archive.

The write protocol is revision-safe and asynchronous. The agent reads the page, rewrites it, and calls put_page with the expected revision and a request id; the caller polls a receipt until the write is committed and the Markdown file is on disk. A lost response replays the same request id; a revision conflict is re-read and retried, never forced.

Git-backed Markdown stays the authority; the database and the vector index are projections. Nightly native maintenance - backlinks, embeddings, orphan scan, a weekly exceptions digest - runs inside the engine. There is no custom verifier and no review queue.

My role shrank to the edges: approve a new client, set its fence, handle destructive operations, and decide anything touching internal or the topology. Everything else is agents writing.

One source, three fences

A shared company source with subject folders and per-agent prefixes, plus a frozen archive and a restricted internal source beside it.

Fence enforced by the server

A write outside the client's prefix returns permission-denied - verified live, not assumed from policy prose.

Git is authority

Durable knowledge is git-backed Markdown. The database and the vector index are projections - diffable, revertible, replaceable.

Labelled retrieval

Search spans the shared source and the archive, and every archive hit is labelled historical. An answer built on an import says so.

01

Connect

A tool logs in over OAuth and self-registers. I approve it once and set its write prefixes.

02

Write

The agent reads the page, rewrites it, and calls put_page with the expected revision and a request id, then polls the receipt until the write is committed.

03

Maintain

Nightly native jobs run inside the engine. A Monday exceptions digest is the only thing that asks for my attention.

04

Escalate

A new client, a destructive operation, anything touching internal, or a topology change comes to me. Nothing else does.

One insight from the old design survived. Before the restructure, the brain reported ~1,900 unverified pages - which read as 1,900 things waiting for a human. Composition analysis showed most were imported reference material that never needed a verdict. That is why they now live in a frozen archive rather than a review queue.

4. The Audit: 1,837 Pages Under a Local Skeptic

Governance rules are prose until something tests them. I ran a full-corpus verification sweep on local models over several nights in early September 2026, against the first version of the company brain (see Revision notes).

Loop design

Each cycle: select a batch of pages, run deterministic checks (frontmatter contract, empty sections, broken citations, secret-shaped strings, orphan and duplicate detection), then hand a bounded sample to a tools-disabled model for compare-and-describe only. Findings are ranked by severity and confidence into a digest. The loop is recommend-only by construction - the writing path is confined to its own digest pages. One brain page carries the cursor and the ledger, so any fresh agent can resume the sweep with no other memory.

Corpus

1,837 pages at sweep time; 1,805 deep-inspected, the rest skip-logged oversize imports or declared exclusions.

Execution

36 cycles across chained runner agents over three nights, roughly 80 pages per runner-hour, every cycle checkpointed and independently verified.

Model placement

Reasoning stayed in-network on local hardware. Company content - including the secrets being hunted - never crossed to an external API for the sweep.

What the skeptic found, in finding classes:

1

Credential leaks

Years-old imported documents carried live-shaped secrets: hundreds of staff phone-number cells, password tables, SQL literals including production-tier logins, and a customer UAT database login. The design had been catching lies - nothing untrusted could become trusted - but not secrets: everything untrusted was readable by every agent.

2

Standard vs engine drift

The canonical standards document mandated a page type that the live schema pack did not define - a contradiction between the two sources of truth that no human had noticed because nothing ever compared them.

3

Duplicate corpora

An entire imported manual set existed as near-duplicate pages - one file per import shard - invisible to keyword search, obvious to a sweep that compares.

4

Graph islands

Reviewed pages cross-referenced each other with relative file links the link graph never indexed - every curated page was an island, which silently degraded retrieval ranking.

I responded to the leaks directly: redacted the live pages, rewrote git history, and purged the database version store - it held the same secrets in page snapshots that any read-scoped agent could have fetched. Scrubbing then moved upstream to intake, so secrets are redacted before they reach a commit.

The incident was not the sweep's real output. I learnt three lessons that changed the architecture:

Protect secrets, not just lies

An integrity boundary stops false claims from becoming truth; it does nothing for true claims that should never have been stored. Confidentiality needed its own gate, at the door.

Unverified is not awaiting-you

A status vocabulary that conflates imported evidence with agent assertions manufactures a review queue nobody can finish. The fix was classification, not more reviewing.

Audit the auditor

Twice the verification tooling itself was wrong - a history scanner broken on the real vault topology, a self-test fixture that never reproduced it. A recommend-only loop survives its own false greens; a self-promoting one would not have.

5. The Personal Brain: A Universal Harness Adapter

Freed from multi-writer governance, my personal brain does a second job: it is the adaptation layer between me and every harness on every device.

Layer 1 · Devices

Workstation, home server, two personal-AI compute modules, an office VM, and a phone. The phone reaches the home server directly over a private mesh; the compute modules are deliberately dumb - they serve models and run sweeps, they do not own knowledge.

Layer 2 · Harnesses

Each device runs its own set of agent harnesses - terminal agents, coding harnesses, a browser-UI harness on the phone. Harnesses differ per device; that variety is accepted, not normalized away.

Layer 3 · Brains

Every harness connects to a brain over MCP. Personal and company brains are separate servers with separate credentials; neither is ever a fallback for the other.

Layer 4 · One skill registry

A single master catalogue of skills, served by the personal brain itself. Personal skills supersede; company adapters are rows inside the registry, not a second registry. Any harness on any device discovers the same skills the same way.

The idea that carries the weight: skills, harness conventions, and device knowledge live in the brain, not in each harness's private configuration. The brain publishes its own skills over MCP; a harness connects, discovers what I know how to do, and inherits my working patterns - routing rules, memory verbs, ingestion discipline - with no per-harness setup. A new device or a new harness is connect-and-go.

The clearest example of the adapter pattern is how memory itself is routed. The brain serves its own memory verbs as skills - /remember, /recall, /forget - and any harness that connects inherits them. /remember is an ingestion router: it takes a write, classifies ownership, and routes it to the correct store - personal notes to the personal brain, company knowledge to the company brain. An explicit destination wins; when ownership is genuinely ambiguous the skill asks rather than guesses, and it never dual-writes. /recall is the retrieval mirror: it selects one brain and searches only that one. The routing policy - what counts as personal, what counts as company, what to do when unsure - lives in the brain, not in any harness.

This is what makes the split operable. Two brains are only safe if every writer routes correctly, and the router is a skill the brain serves - not a convention each harness must reimplement. A new knowledge source is a new row in the routing table, not a new integration in every harness.

That is why my personal brain can stay permissive where the company brain must be strict. Single owner, no third-party subjects, git-backed and reversible: the cost of a bad write is a bad note, and the remedy is a revert. The same properties would be negligence on the company side.

6. Division of Labor: Who Built What

Both halves of this system were built by a small team of models and harnesses, and the build itself demonstrates the pattern: a frontier-class model for judgment, high-throughput local serving for volume, and coding agents for the hands-on cutover work.

Qwen 3.8 Flash Next - the audit, on local hardware

The headline worker. Served locally on two NVIDIA DGX Sparks behind a LiteLLM front, it ran the 1,837-page verification sweep - 1,805 pages deep-inspected across 36 cycles over three nights, at roughly 80 pages per runner-hour - entirely in-network: company content, including the secrets being hunted, never left the LAN. It found the credential leaks, the standard-vs-engine drift, the duplicate corpora, and the graph islands described in Section 4. The audit that changed the architecture ran on hardware I own, on an open-weight model.

Qwen 3.8 Max - planning

Designed the company brain's two-source model, the enforced write boundary, and the promotion policy; drafted the two-lane promotion RFC and the big-vs-small change classifier; designed the leak-scrub engine, intake-time redaction, and the verifier runner's safety gates; held multi-day state across sessions via brain pages.

Devin (Cognition) - the cutover and the re-simplification

Company brain, 21-22 Sep 2026: upgraded the engine to stock upstream GBrain 0.51 with its managed writer and retired the custom capture-verify-promote pipeline in favour of the engine's native model - one shared company source with folder prefixes, a frozen archive source holding ~1,160 historical imports, a restricted internal source, per-agent server-enforced write fences (each agent writes only under its own agents/<name>/ plus products/), native OAuth with dynamic client registration behind a Cloudflare tunnel, every legacy unscoped token revoked, and all five agent clients - two OpenClaw agents, one Hermes specialist, two coding harness clients - re-issued as fenced clients. Nightly native maintenance timers replaced the custom verifier; I now approve new clients and handle exceptions only.

Personal brain, 18-22 Sep 2026: the numbered-root restructure (139 moves left as alias stubs so old links still resolve), a 50-portfolio/ root mirroring this site 1:1, reconciliation of 155 company pages out of the personal brain into the company brain (pointer stubs left behind), the "state of the brain" page, a portfolio gap-fill from a full site inventory, an audit of all 13 MacBook harnesses against the registry with the two dead company connections repaired, and a connector health-check page any agent can run.

Codex (OpenAI) - host operations and the action layer

On the personal brain's Mac mini host: the attended 0.48.5→0.50.5 engine upgrade (sha-verified backup, rollback pair recorded), local patches rebased as a pinned integration branch, vault Git backup to a private GitHub repo behind a repo-scoped deploy key, page-type consolidation 57→30 with a personal schema pack, and the chunk reindex. Earlier, on 13 Sep: the harness skill inventory and the action-first design that made /remember and /recall the only top-level memory routers - the pattern Section 5 describes - plus the company deployment packaging branch.

omp session (15 Sep) - the target architecture

The four-layer harness-to-brain architecture in Figure 3 - connect-the-MCP-and-go, one master skill registry, company adapters as rows - was agreed in an omp harness session. A harness session, not a model claim.

The pairing is the point. Planning work is low-volume and high-consequence - a wrong promotion policy is a design flaw that lives for years - so it gets the strongest available reasoning. Verification is high-volume and mechanically bounded - each page either passes the checks or it does not - so it gets cheap, fast, local throughput on hardware I own. And the build itself used several harnesses, which is exactly what the Section 5 adapter layer exists for.

7. Discussion

When this design applies, and where it breaks.

When to split

Split whenever writer population, subject ownership, or failure cost differs between your agents' worlds. One brain is fine for a single writer with no regulated subjects; it fails the moment other people's data or other agents' credentials enter.

Failure mode: surface drift

Git, the brain's page store, and the runner's checkpoint are three surfaces that can disagree. The fix is naming one durable authority and reconciling the others against it - and checking, not assuming, that reconciliation happened.

Failure mode: over-gating

I ran a human review queue for two weeks. It reached 19 reviewed pages against ~1,900 waiting. That is not governance, it is a backlog.

Failure mode: under-gating

The integrity boundary caught every lie and every leak survived it. Confidentiality is a separate property and needs its own gate at intake, plus history and version-store hygiene when something slips through.

What I would change

Start from the engine's own fences instead of building a promotion pipeline on top. Scrub at intake from day one. Separate evidence from assertion in the status vocabulary from day one. Test audit tooling against the real storage topology.

The release posture follows directly. Reading the company brain is safe today - archive hits are labelled historical. Writing is open to every fenced agent. The remaining work is off-host backup of the Git vault and moving the nightly synthesis onto the engine's native provider path. If you run agents against shared memory, tell me where this breaks for you.

References

Systems and models referenced in this paper.

Models and hardware

  • Qwen - Qwen 3.8 Max (planning) and Qwen 3.8 Flash Next (sweep).
  • NVIDIA DGX Spark - two units serving the sweep models locally.
  • LiteLLM - the model-serving front used by the agent harnesses.

Protocols

  • Model Context Protocol - the connection layer between every harness and both brains.
  • Git-backed Markdown as durable authority; database and vector index as projections.

Revision notes

22 September 2026 - the earlier design, and why I replaced it.

Until 21 September 2026 the company brain ran a different design: agents could only write to an unreviewed captures tier, an intake scrub redacted secrets, a nightly local-model verifier wrote recommend-only digests, and only a human PR moved a page into a reviewed tier. It was correct on paper, and it is what the Section 4 audit tested.

It did not work for me. The reviewed tier stalled at 19 pages against ~1,900 captures; I was the bottleneck. Once intake scrubbing and the audit had cleaned the corpus, the risk left was where an agent could write, not whether I had signed - and the engine already shipped that control natively. I also did not want to maintain a custom pipeline on top of an engine whose authors had solved the problem differently.

On 21-22 September I moved it to stock GBrain 0.51. The pipeline was retired - nothing deleted; the old captures source is soft-archived and restorable - and replaced by one shared source plus the frozen archive plus internal, per-agent fences, OAuth clients with every legacy token revoked, and native nightly maintenance. Devin did the cutover; the details are in Section 6.

What I gave up: the guarantee that a human had read every page before an agent could cite it. What I kept: Git history as the audit trail, labelled retrieval, credential isolation, and the physical split of Section 2. Whether fences alone are enough is the question the next revision should answer.

This paper continues the research programme from Why a Knowledge Management Layer Still Matters, which argues the retrieval-side case for a structured KM layer.