Caching 

The extension uses two TYPO3 caches to reduce API calls and improve response time:

  1. AI-generated answer (cache identifier: kesearchai_results)

    The final text returned by the LLM is cached per search. Each cache entry is identified by a key derived from the search term, the Top K setting, the minimum similarity score setting, and the answer language (e.g. from the current site language). When a user searches with the same term and language and the entry is still valid, the answer is taken from the cache and no embedding or LLM request is made.

    Lifetime is set with Cache in the Extension Manager (aiCacheLifetime, in seconds; default 2592000 = 30 days). Set to 0 to disable this cache.

  2. Query and index embeddings (cache identifier: kesearchai_embeddings)

    The same cache is used in two places:

    • At search time: When generating an answer, the search term is converted into a vector via the embedding API. That query vector is cached per search term (and per embedding API URL and model). If the same search term is used again before the cache entry expires, the embedding API is not called and the stored vector is reused for the similarity search.
    • When building the embedding index: The console command ke_search_ai:embeddingindex also uses this cache. For each index entry, the chunk text (title, abstract, content) is hashed and the resulting embedding is stored in the cache. When you run the command again (e.g. with --update), entries whose source text has not changed get their embedding from the cache instead of calling the embedding API. Duplicate or similar content across index entries also benefits from cache hits. The command’s --limit option counts only API calls; cache hits do not count toward the limit.

    Lifetime is configured with Embedding cache lifetime (aiEmbeddingCacheLifetime, default 2592000 seconds = 30 days). This reduces embedding API cost both for repeated search terms and when (re)building the embedding index.