DRAFT STAGING ARTIFACT — a plain-language summary of the engineering documentation in this project's repository, not a new claim.
SecondBrainDB

Architecture

MySQL as the durable system of record; a small stdlib HTTP API on top; everything scoped to a tenant, and now a workspace and an agent, at every layer.

The shape of it

AI agent / human teammate │ Authorization: Bearer <api_key> ▼ HTTP API (stdlib, no framework) ──▶ fail-closed authz: resolve tenant + agent │ server-side from the key, never from │ the request body ▼ MySQL 8.0, InnoDB (system of record) tenants → workspaces → agents → memories (visibility + shares) → audit_log ↘ decisions, jobs/events, tags, relationships Optional, never authoritative: Vector index (e.g. Qdrant) — rebuildable from memories + sources, an accelerator for ranking, never the only copy of the data.

Design principles

PrincipleWhat it means in practice
Multi-tenant from the startEvery table that holds tenant data carries tenant_id, and every uniqueness rule is scoped to it — not a global key that could silently merge two customers' records.
Append-only where it's evidenceMemories, audit entries, and job events are never overwritten in place. An "edit" inserts a new, linked row.
Hash-chained logsThe audit log and job-event log are hash-chained, so a dropped or reordered entry is detectable, not just assumed absent.
Fail-closed identityWho's asking is always resolved server-side from the API key. A request can never claim a different tenant or agent and have it take effect.
Relational source of truthMySQL holds the authoritative data. Any future vector/semantic index is an optional, rebuildable accelerator — losing it costs ranking quality, never data.

Security

Built and tested today:

Not yet built — required before any real customer data is stored:

No compliance certification (SOC 2, ISO 27001, HIPAA, or otherwise) is claimed anywhere — none has been pursued or obtained.

Testing, honestly stated

54 automated tests pass as of this writing: 28 unit tests with no database involved, and 26 integration tests against a real, disposable, 127.0.0.1-only MySQL 8.0 container created and torn down by the test suite itself — never a persistent host install. Coverage specifically includes cross-tenant isolation, cross-workspace write denial, and the private/workspace/tenant visibility and explicit-sharing rules.