second-brain/src/second_brain
Travis Herbranson ceeae77e7d postgres migration: schema, models, embeddings, alembic
Swap the SQLite backing store for petalbrain Postgres + pgvector, modeled
on vault-mcp. All second-brain relational tables now live in the
`second_brain` schema (owned by the lovebug role); embeddings are written
to the shared public.embeddings table.

Locked design decisions (per Travis):
- DB: existing petalbrain Postgres, second_brain schema, lovebug role.
- Connection: containerized homelab-postgres:5432, plain psycopg_pool
  (min=1/max=10), no PgBouncer.
- ORM stays SQLAlchemy; int autoincrement PKs + naive UTC DateTime.
- Embeddings: reuse shared public.embeddings keyed by
  (source_schema='second_brain', source_table='extractions', source_id,
  model='nomic-embed-text'). Summaries only for this round.
- Pipeline: chunk_text → Ollama nomic-embed-text → delete-before-insert
  upsert, with graceful degradation (no DB / no Ollama → log + skip).
- Alembic stands up second-brain's own schema; public.embeddings stays
  out-of-band.
- File-based wiki compiler is unchanged.

No SQLite data import — starting clean.

This commit is the scaffolding only; `alembic upgrade head` and a smoke
test of the embedding path are the next checkpoint.
2026-05-24 22:46:48 -04:00
..
adapters project init 2026-05-22 19:08:22 -04:00
compiler switch extractor to Claude CLI backend + pipeline fixes 2026-05-24 21:09:20 -04:00
context project init 2026-05-22 19:08:22 -04:00
embeddings postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
extractor switch extractor to Claude CLI backend + pipeline fixes 2026-05-24 21:09:20 -04:00
llm switch extractor to Claude CLI backend + pipeline fixes 2026-05-24 21:09:20 -04:00
scheduler postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
web update to fix website error 2026-05-24 21:38:52 -04:00
__init__.py project init 2026-05-22 19:08:22 -04:00
config.py postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
database.py postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
main.py postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00
models.py postgres migration: schema, models, embeddings, alembic 2026-05-24 22:46:48 -04:00