Cost per query is the sum of embedding the query, vector database and keyword search, optional reranker, and LLM input and output tokens; the LLM usually dominates, driven by how many chunk tokens you send.
Reduce it by retrieving fewer and better chunks, compressing context, routing easy questions to smaller models, caching answers and embeddings, using prompt caching for static prefixes, and limiting output length.
Indexing cost is separate (parsing, embeddings, enrichment such as LLM-generated context), so avoid re-embedding unchanged content, and track cost per resolved question rather than only per request.
Loading…