Skip to main content

What it does

  • Reads every markdown file in the hub and parses YAML frontmatter against the hub schema.
  • Chunks each body by heading.
  • Embeds chunks via Ollama (default nomic-embed-text), OpenAI (text-embedding-3-small), or a deterministic local-hash fallback for CI.
  • Upserts chunks into Qdrant with payload indices on kh_id, scope, scope_prefixes, sensitivity, source_type, team, and tags.
  • Maintains a Postgres manifest so unchanged files are skipped on subsequent runs.
  • Sweeps orphans — IDs in the manifest but no longer in the hub get deleted from both Qdrant and the manifest.

Embedding providers

  • Ollama (default): runs against a local or remote Ollama instance.
  • OpenAI: hosted embedding API.
  • Hash: deterministic local fallback for CI smoke tests; never used in production.
If the configured provider can’t be reached, the run aborts. There is no silent fallback in production.

CLI

Configuration

The manifest write is skipped under --no-manifest (first runs, debug, or when Postgres is unavailable) and under --dry-run.