Help us improve
Share bugs, ideas, or general feedback.
From open-second-brain
Walks through setting up semantic search for Open Second Brain: configuring an embedding API key, installing sqlite-vec, and running the first reindex.
How this skill is triggered — by the user, by Claude, or both
Slash command
/open-second-brain:embeddings-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Open Second Brain ships with two search paths: keyword-only (always
Share bugs, ideas, or general feedback.
Open Second Brain ships with two search paths: keyword-only (always
on, no credentials) and semantic via embedded vectors (opt-in). This
SKILL walks the activation flow for the semantic path. The flow is
proactive — when the user mentions semantic search or o2b search check surfaces missing pieces, take the user through this list
rather than waiting for explicit instruction.
o2b search checko2b search check
The output names every missing piece and ends with a
recommendations: block listing the exact commands to fix each.
Read both before suggesting next steps. The recommendations field
is also present in the --json output for headless callers.
Branch on what the report shows:
embedding_key: MISSING → go to step 2.vec_extension: unavailable on macOS → go to step 3.vec_extension: unavailable on Linux → go to step 4.semantic_enabled: false (no embeddings yet) →
go to step 5.Ask the user which provider they want. The default is
text-embedding-3-small from OpenAI (about $0.02 per 1M tokens,
which covers tens of thousands of vault pages). Any OpenAI-compatible
endpoint works — Groq, Together, a local LM Studio server, etc.
Required env vars (write to ~/.hermes/.env or the configured env
file, never to a tracked file):
OPEN_SECOND_BRAIN_EMBEDDING_PROVIDER=openai-compat
OPEN_SECOND_BRAIN_EMBEDDING_MODEL=text-embedding-3-small
OPEN_SECOND_BRAIN_EMBEDDING_KEY=<placeholder; user pastes the key>
# Optional — only when not using OpenAI:
# OPEN_SECOND_BRAIN_EMBEDDING_BASE_URL=https://api.together.xyz/v1
Never invent or echo the key. Write a placeholder, then ask the
user to paste their key in place of it. Recheck with o2b search check after the user confirms.
Apple ships /usr/lib/libsqlite3.dylib with
SQLITE_OMIT_LOAD_EXTENSION, so the optional sqlite-vec extension
cannot load against the system SQLite. Homebrew's sqlite formula
is built with extension loading enabled.
brew install sqlite
The o2b wrapper auto-detects Homebrew SQLite on Darwin and exports
DYLD_LIBRARY_PATH for bun:sqlite on the next invocation. No
manual patching of the wrapper script is needed (the v0.10.5 shim
scripts/_macos-sqlite.sh handles it). Verify with:
o2b search check
Expect vec_extension: loaded.
sqlite-vec ships as an optional dependency. If the install path
missed it, force a rebuild:
bun pm ls | grep sqlite-vec
bun install --force
If the package is present but still does not load, the Linux build
of libsqlite3 may have been compiled without LOAD_EXTENSION.
Capture sqlite3 :memory: "PRAGMA compile_options;" and surface it
to the user — they will know whether their distro's SQLite is
unusual.
o2b search reindex --embeddings
This walks the vault, chunks every Markdown file, and computes embeddings. Cost scales linearly with vault size — a 150-file vault typically lands in a few seconds.
Verify semantic search works:
o2b search "preferences for code review"
The output rows carry (semantic) in the source column when the
match came from the vector index.
The vault keeps changing — other agents add notes, the user edits existing ones. Without periodic refresh the embeddings drift behind the keyword index.
o2b search reindex --cron-template
Prints a watchdog script (a heredoc that, when the operator runs
the printed block, lands at ~/.local/bin/osb-reindex.sh), a
native crontab line, and a hermes cron create command. Pure
stdout — the verb writes nothing on its own; pick the path that
matches the host and paste the relevant section into your
shell / crontab. Recommended cadence:
Override with --interval 6h (or any <N>m|h|d value below 60m / 24h
/ unlimited days).
Only the agent that runs reindex needs
OPEN_SECOND_BRAIN_EMBEDDING_KEY. Read-only consumers (sibling
Claude Code / Codex / OpenClaw sessions on the same vault) query
the already-computed vectors and never see the key. When designating
the reindex owner, the canonical choice is Hermes (it carries the
cron infrastructure); the others stay credential-free.
brew install on the user's behalf. The SKILL
prints the command; the user runs it.--cron-template recipe is the endorsed automation path.npx claudepluginhub itechmeat/open-second-brain --plugin open-second-brainImplements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.
Designs and optimizes vector database architectures for semantic search, RAG, and recommendation systems using Pinecone, Weaviate, Qdrant, Milvus, and pgvector.
Configure pgvector extension for vector search in Supabase - includes embedding storage, HNSW/IVFFlat indexes, hybrid search setup, and AI-optimized query patterns. Use when setting up vector search, building RAG systems, configuring semantic search, creating embedding storage, or when user mentions pgvector, vector database, embeddings, semantic search, or hybrid search.