Skip to main content

Module llm_embedding

Module llm_embedding 

Source
Expand description

LLM-based embedding backend (v1.0.76 default).

LlmEmbedding is the production embedding client. It wraps a single headless invocation of claude code or codex and returns a 384-dim f32 vector parsed from the LLM’s JSONL response.

The embedding model is the same multilingual-e5-small from before, but the call now goes through the LLM’s tool-use protocol (no MCP, no hooks). This is the single reason the binary is now one-shot: there is no daemon to keep the model loaded, the LLM subprocess is spawned on demand and killed when the response is parsed.

OAuth is the only supported credential path. The constructor rejects ANTHROPIC_API_KEY / OPENAI_API_KEY in the environment — see v1.0.69 (G31) OAuth-Only Enforcement.

Structs§

LlmEmbedding

Enums§

EmbeddingFlavour

Constants§

EMBEDDING_DIM
Dimensionality of the embedding space. Matches the previous multilingual-e5-small model output and the memory_embeddings.embedding BLOB column size.

Functions§

resolve_real_binary
Follows symlinks and shell-script shim exec targets to find the real ELF binary. Shim wrappers (like ~/.graphrag-shim/codex) can strip hardening flags; bypassing them is a security requirement.