Technique

Embeddings Cache

Local store keyed by content hash so repeated inputs aren't re-embedded — cuts cost.

Definition

Embedding APIs charge per token, so caching results by content hash avoids paying twice. The cache typically lives in Redis or a key-value store keyed by SHA-256 of the input plus model name. Standard pattern in RAG ingestion pipelines.

Common use cases

  • Ingestion pipelines
  • Cost reduction
  • Idempotency

Related terms

    Embeddings Cache — AI Glossary | Railwail