面向低延迟LLM网络搜索的三层缓存架构:基于商用CPU硬件

·

研究论文 · 2026/09/11

我们开发了OreoLook(原lixSearch),一个使用自动化浏览器代理和提供商路由LLM推理的开源答案引擎。其本地搜索、缓存、会话管理和嵌入栈在商用CPU硬件上运行;答案合成由远程推理提供商执行。随着使用量增长,会话丢失上下文,等价查询触发冗余工作,URL在不同会话中被重复嵌入。我们提出三层缓存架构:(1)会话上下文窗口,在Redis中维护近期消息的滚动窗口,并自动溢出到Huffman压缩的磁盘存档;(2)语义查询缓存,通过嵌入向量的余弦相似度捕获改写查询,消除冗余LLM调用;(3)URL嵌入缓存,跨会话去重嵌入计算。在单台8 vCPU Intel Cascade Lake服务器(2 GHz,32 GB RAM)上部署,运行30个Hypercorn工作进程,跨三个容器化副本,评估系统报告了89.3%的聚合Redis键空间命中率,读取延迟0.1毫秒,内存开销仅1.38 MB。后台LRU驱逐守护进程将空闲会话从Redis迁移到磁盘,并按需重新水合,使得对话可以在配置的保留策略下在数小时或数天后恢复。

该文章展示了一种在商用CPU硬件上实现低延迟LLM网络搜索的实用缓存架构,通过具体性能指标验证了其有效性,对构建高效、可扩展的AI搜索系统具有参考价值。

AI-powered search products such as ChatGPT search, Google's AI Overviews, and Perplexity provide LLM-synthesized answers grounded in live web results. We developed OreoLook (formerly lixSearch), an open-source answer engine using automated browser agents and provider-routed LLM inference. Its local search, caching, session-management, and embedding stack runs on commodity CPU hardware; answer synthesis is performed by a remote inference provider. As usage grew, sessions lost context, equivalent queries triggered redundant work, and URLs were repeatedly embedded across sessions. We present a three-layer caching architecture: (1) a Session Context Window maintaining a rolling window of recent messages in Redis with automatic overflow to Huffman-compressed disk archives; (2) a Semantic Query Cache catches rephrasings via cosine similarity on embedding vectors, eliminating redundant LLM invocations; and (3) a URL Embedding Cache that deduplicates embedding computations across sessions. Deployed on a single 8-vCPU Intel Cascade Lake server (2 GHz, 32 GB RAM) running 30 Hypercorn worker processes across three containerized replicas, the evaluated system reported an 89.3% aggregate Redis keyspace hit rate with 0.1 ms read latency and just 1.38 MB of memory overhead. A background LRU eviction daemon migrates idle sessions from Redis to disk and re-hydrates them on demand, enabling conversations that can be resumed hours or days later under the configured retention policy.

阅读原文

参与讨论