soju embed-index

Purpose: Build the Ollama embedding cache used by Practice retrieval (data/cache/embeddings/). Embeds every registry vocabulary entry and every grammar pattern from the grammar manifest.

Reads

data/content/registry/vocabulary.yaml, data/content/grammar/manifest.yaml

Writes

data/cache/embeddings/{meta.json,vocab.jsonl,grammar.jsonl} (gitignored)

Exit codes

0 success · 1 Ollama / embed failure · 2 invalid flags

                                                                              
 Usage: soju embed-index [OPTIONS]                                            
                                                                              
 Build the Ollama embedding cache for Practice retrieval                      
 (data/cache/embeddings/).                                                    
                                                                              
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ --base-url           <str>  Ollama base URL                                │
│                             [default: http://localhost:11434]              │
│ --embed-model        <str>  Ollama embedding model (default:               │
│                             SOJU_EMBED_MODEL or nomic-embed-text)          │
│                             [default: nomic-embed-text]                    │
│ --batch-size         <int>  Documents per Ollama /api/embed batch request  │
│                             [default: 32]                                  │
│ --dry-run                   Count documents to embed without calling       │
│                             Ollama                                         │
│ --help                      Show this message and exit.                    │
╰────────────────────────────────────────────────────────────────────────────╯
uv run soju embed-index --dry-run
uv run poe embed-index
uv run soju embed-index --embed-model nomic-embed-text --batch-size 32

Requires a reachable Ollama server with the embedding model pulled (default nomic-embed-text, or SOJU_EMBED_MODEL / --embed-model). Keep that model aligned with backend llm.embed_model (surfaced to the browser via /v1/soju/config/client). See AI practice & chat for the full Practice flow.