wiki-vault/Wiki/Homelab/petalbrain.md
Travis Herbranson 75ba9f005a compile: promote 5 entities (trellis, vault-mcp, petalbrain, knot-dns, herbyeos)
User-approved promotions from the prior compile's proposal list.
pbs-hub-mcp deferred per user. Wiki domain indexes updated to list the new
entities; Sources left untouched (MCP-written/immutable).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 21:27:52 -04:00

51 lines
3.3 KiB
Markdown

---
type: entity
path: Wiki/Homelab
tags:
- pgvector
- embeddings
- mcp
- ob1
- homelab
created: 2026-05-24
updated: 2026-05-24
---
# petalbrain
## What it is
petalbrain is the consolidated Postgres database that backs all three of Travis's memory systems. It is a single `pgvector/pgvector:pg17` instance (container `homelab-postgres`) holding three schemas — `wiki`, `ob1`, `trellis` — plus a shared `public.embeddings` vector store. It was created by consolidating three previously separate databases (`herbylab`, `openbrain`, `trellis`) so the cross-cutting reflection/search queries that span all three become free intra-database joins instead of cross-database FDW taxes. The name replaced `openbrain`, which became misleading once the DB also held wiki and trellis content.
## Current state
Live. Layout:
- **Schema `wiki`** — owned by `vault_mcp`; `artifacts` / `projects` / `notes`
- **Schema `ob1`** — owned by `ob1_mcp`; `ob1.thoughts` (raw) + `ob1.reflections` (compiled)
- **Schema `trellis`** — owned by `trellis_mcp`; threads / events / tags
- **`public.embeddings`** — shared across all sources, owned by `postgres`; `VECTOR(768)` (Ollama `nomic-embed-text`), HNSW `vector_cosine_ops` (m=16, ef_construction=64), keyed `(source_schema, source_table, source_id, embedding_model)`; 512-token chunks / 64 overlap
- **Service roles** — `vault_mcp` / `ob1_mcp` / `trellis_mcp` each own their schema; `ob1_mcp` reads `wiki` + `trellis` for reflection synthesis; `lovebug` is RW everywhere. Isolation enforced at the Postgres role level (verified with positive permission-denied tests).
## Where it lives
- Container `homelab-postgres` (`pgvector/pgvector:pg17`), `/opt/projects/docker/postgres/`, bound to `127.0.0.1:5433`, external volume `ob1_data`, on the `homelab` Docker network — Proxmox
- Credentials for the four service roles in `/opt/backups/postgres-consolidation/credentials.env` (0600) for KeePassXC transcription
- Pre-migration dumps + rollback runbook in `/opt/backups/postgres-consolidation/`
## Related projects
- [[Sources/Homelab/postgres-consolidation-ob1-reflection-layer|postgres-consolidation-ob1-reflection-layer]] — the consolidation + reflection plan
- [[Sources/Homelab/postgres-consolidation-followups|postgres-consolidation-followups]] — activation, verification, Phase 8 cleanup
- [[Sources/Homelab/2026-05-15-postgres-consolidation-phase0-recon|phase0-recon]] — pre-consolidation instance inventory
- [[Sources/Homelab/2026-05-15-postgres-consolidation-phase2a-result|phase2a-result]] — schemas + roles + embeddings landed
- [[Wiki/Reference/ob1|ob1]] · [[Wiki/Reference/vault-mcp|vault-mcp]] · [[Wiki/Reference/trellis|trellis]] — the three consumers
- [[Wiki/Homelab/proxmox|proxmox]] — host
- [[Wiki/Dev/ai-memory-architecture|ai-memory-architecture]] — synthesis
## History
- **2026-05-14** — OB1 embedding dim migrated 1536→768 for `nomic-embed-text` (precursor)
- **2026-05-15** — Phase 0 recon; Phase 2a landed the `wiki` + `trellis` schemas, four service roles, and the empty `public.embeddings` table inside `openbrain`, disruption-free
- **2026-05** — `openbrain` renamed to `petalbrain`; `public.thoughts``ob1.thoughts`; embeddings backfilled; MCP connection strings cut over
- **Open** — Phase 8 cleanup: drop the old standalone `herbylab` / `trellis` DBs after the verification window