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.
70 lines
2.5 KiB
Plaintext
70 lines
2.5 KiB
Plaintext
# second-brain runtime configuration
|
|
# Copy this file and edit paths to match your setup.
|
|
# Override the config file path with SECOND_BRAIN_CONFIG env var.
|
|
|
|
# Path to your Obsidian vault (git-managed directory). The wiki compiler
|
|
# writes markdown into this directory and commits inside it. We do NOT
|
|
# dual-write into petalbrain.wiki — the file-based vault stays canonical.
|
|
vault_path = "~/Documents/second-brain-vault"
|
|
|
|
# Directory where downloaded media files are stored
|
|
media_dir = "~/.local/share/second-brain/media"
|
|
|
|
# Directory where Whisper SRT transcripts are stored
|
|
subtitles_dir = "~/.local/share/second-brain/subtitles"
|
|
|
|
# Whisper model size: tiny | base | small | medium | large
|
|
# small is a good balance of speed and accuracy
|
|
whisper_model = "small"
|
|
|
|
# Active knowledge domains
|
|
domains = ["development", "content", "business", "homelab"]
|
|
|
|
[database]
|
|
# Postgres + pgvector lives on the petalbrain instance.
|
|
#
|
|
# Preferred: leave `url` empty and export SECOND_BRAIN_DATABASE_URL (or the
|
|
# shared HERBYLAB_DATABASE_URL) in the environment so the password never
|
|
# lands in this checked-in file.
|
|
#
|
|
# Containerised second-brain runs should target homelab-postgres on the
|
|
# homelab docker network:
|
|
# postgresql+psycopg://lovebug:<password>@homelab-postgres:5432/petalbrain
|
|
#
|
|
# Host-side dev runs can point at the published port instead:
|
|
# postgresql+psycopg://lovebug:<password>@127.0.0.1:5433/petalbrain
|
|
url = ""
|
|
|
|
[extractor]
|
|
# "cli" → runs `claude -p` under your Max OAuth (no per-token billing).
|
|
# "api" → uses Anthropic SDK, requires ANTHROPIC_API_KEY.
|
|
backend = "cli"
|
|
model = "claude-sonnet-4-6"
|
|
cli_binary = "claude"
|
|
timeout_sec = 600
|
|
|
|
[embeddings]
|
|
# Best-effort: extraction summaries are chunked (512 tokens / 64 overlap)
|
|
# and embedded via Ollama's nomic-embed-text (768-d) into the shared
|
|
# public.embeddings table. Failures (no DB / no Ollama) log a warning and
|
|
# the pipeline keeps moving — the relational + file vault stay canonical.
|
|
enabled = true
|
|
# Containerized default; for host-side runs set OLLAMA_URL=http://127.0.0.1:11434
|
|
ollama_url = "http://ollama:11434"
|
|
model = "nomic-embed-text"
|
|
embed_field = "summary"
|
|
|
|
[scheduler]
|
|
# Time window for overnight processing (24h format, may cross midnight)
|
|
window_start = "22:00"
|
|
window_end = "06:00"
|
|
|
|
# CLI backend: cap calls per rolling hour (Max sub has 5h-window message caps).
|
|
max_calls_per_hour = 30
|
|
|
|
# Minimum seconds between extraction calls (rate-limit smoother)
|
|
min_gap_seconds = 120
|
|
|
|
# Legacy API-backend budget (only enforced when extractor.backend = "api").
|
|
max_tokens_per_hour = 100_000
|