Skip to content

embed

fialr embed <target> [options]

Compute vector embeddings for files in the target directory. Embeddings enable semantic search, enrichment context, and embedding-based deduplication. Runs locally via Ollama.

The recommended way to compute embeddings is via fialr enrich --embed-only <target>. This computes embeddings without running AI text extraction or inference. Use it to backfill embeddings for files enriched before embeddings were enabled, or to recompute after a model change.


ArgumentDescription
targetDirectory or file to embed
OptionDescription
--model MODELEmbedding model (default: nomic-embed-text)
--forceRecompute embeddings for files that already have them
--limit NMaximum files to process
-v, --verboseShow debug output

For each file in the target that has been enriched (has metadata in the database), embed extracts the text content, sends it to the configured embedding model via Ollama, and stores the resulting vector in the embeddings table.

Vectors are stored as packed binary (little-endian floats) for efficient storage and retrieval. The default model (nomic-embed-text) produces 768-dimensional vectors with an 8192-token context window.

If the embedding model is not yet pulled, fialr auto-pulls it on first use.

  • Semantic search. fialr search --semantic finds files by meaning, not keywords.
  • Similar files. fialr similar finds semantically related files across the corpus.
  • Enrichment context. During enrichment, embeddings locate similar high-confidence files to use as few-shot examples, improving metadata quality as the corpus grows.
  • Embedding-based dedup. Supplements hash-based and TF-IDF near-duplicate detection with semantic similarity.

embed ~/Documents
EMBED Processing 2,847 files
────────────────────────────────────────────────────────
model nomic-embed-text (768 dims)
new 2,312 embeddings computed
skip 535 already embedded
fail 0 errors

Terminal window
# Embed all enriched files in a directory
fialr embed ~/Documents
# Recompute all embeddings (e.g., after model change)
fialr embed ~/Documents --force
# Embed a single file
fialr embed ~/Documents/contract.pdf

Embedding settings in fialr.toml:

[embeddings]
enabled = true
model = "nomic-embed-text"
dimensions = 768
similarity_threshold = 0.8

Set enabled = false to disable all embedding functionality.


  • enrich--embed-only flag for embedding without inference
  • search — search with --semantic or --similar flags
  • Enrichment guide — how embeddings improve enrichment quality
  • Search guide — semantic search workflow