AI Skill Hub 推荐使用:AI缓存库 是一款优质的Agent工作流。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Agent工作流解决方案,这是一个值得深入了解的选择。
AI缓存库 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
AI缓存库 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install omnicache-ai
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install omnicache-ai
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/ashishpatel26/omnicache-ai
cd omnicache-ai
pip install -e .
# 验证安装
python -c "import omnicache_ai; print('安装成功')"
# 命令行使用
omnicache-ai --help
# 基本用法
omnicache-ai input_file -o output_file
# Python 代码中调用
import omnicache_ai
# 示例
result = omnicache_ai.process("input")
print(result)
# omnicache-ai 配置文件示例(config.yml) app: name: "omnicache-ai" debug: false log_level: "INFO" # 运行时指定配置文件 omnicache-ai --config config.yml # 或通过环境变量配置 export OMNICACHE_AI_API_KEY="your-key" export OMNICACHE_AI_OUTPUT_DIR="./output"
<p><strong>Unified multi-layer caching for AI Agent pipelines.</strong><br/> Drop it in front of any LLM call, embedding, retrieval query, or agent workflow<br/> to eliminate redundant API calls and cut latency and cost.</p>
</div>
---
diskcache, numpy (installed automatically)uv run pytest tests/adapters/ -v ```
---
```bash
git clone https://github.com/ashishpatel26/omnicache-ai cd omnicache-ai uv sync --dev
uv run pre-commit install
---
from omnicache_ai import CacheManager, InMemoryBackend, CacheKeyBuilder
manager = CacheManager(
backend=InMemoryBackend(),
key_builder=CacheKeyBuilder(namespace="myapp"),
)
manager.set("my_key", {"result": 42}, ttl=60)
value = manager.get("my_key") # {"result": 42}
| Variable | Default | Values |
|---|---|---|
OMNICACHE_BACKEND | memory | memory · disk · redis |
OMNICACHE_REDIS_URL | redis://localhost:6379/0 | Any Redis URL |
OMNICACHE_DISK_PATH | /tmp/omnicache | Any writable path |
OMNICACHE_DEFAULT_TTL | 3600 | Seconds;0 = no expiry |
OMNICACHE_NAMESPACE | omnicache | Key prefix string |
OMNICACHE_SEMANTIC_THRESHOLD | 0.95 | Float 0–1 |
OMNICACHE_TTL_EMBEDDING | 86400 | Per-layer override |
OMNICACHE_TTL_RETRIEVAL | 3600 | Per-layer override |
OMNICACHE_TTL_CONTEXT | 1800 | Per-layer override |
OMNICACHE_TTL_RESPONSE | 600 | Per-layer override |
export OMNICACHE_BACKEND=redis
export OMNICACHE_REDIS_URL=redis://localhost:6379/0
export OMNICACHE_DEFAULT_TTL=3600
from omnicache_ai import CacheManager, OmnicacheSettings
manager = CacheManager.from_settings(OmnicacheSettings.from_env())
---
from autogen_agentchat.agents import AssistantAgent from omnicache_ai.adapters.autogen_adapter import AutoGenCacheAdapter
agent = AssistantAgent("assistant", model_client=...) cached = AutoGenCacheAdapter(agent, manager) result = await cached.arun("What is 2+2?")
from agents import Agent, Runner
from omnicache_ai.adapters.openai_agents_adapter import OpenAIAgentsCacheAdapter
agent = Agent(name="assistant", instructions="Be concise", model="gpt-4o")
adapter = OpenAIAgentsCacheAdapter(manager)
result = adapter.run(agent, "What is RAG?")
result = await adapter.arun(agent, "What is RAG?") # async
from omnicache_ai.adapters.claude_agent_adapter import ClaudeAgentCacheAdapter
adapter = ClaudeAgentCacheAdapter(manager)
async for msg in adapter.query("Fix the import error in utils.py", options=options):
print(msg) # streams on first call, replays from cache on second
```python import openai from omnicache_ai.adapters.openai_adapter import OpenAICacheAdapter
client = openai.OpenAI() adapter = OpenAICacheAdapter(client, manager)
response = adapter.chat_create( model="gpt-4o", messages=[{"role": "user", "content": "Hello"}], )
```python import anthropic from omnicache_ai.adapters.anthropic_adapter import AnthropicCacheAdapter
client = anthropic.Anthropic() adapter = AnthropicCacheAdapter(client, manager)
response = adapter.messages_create( model="claude-sonnet-4-6", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], )
---
---
omnicache-ai 是专为 AI Agent 流水线设计的统一多层缓存解决方案。通过将其集成到任何 LLM 调用、Embedding、检索查询或 Agent 工作流中,开发者可以有效消除冗余的 API 调用,显著降低响应延迟并节省 API 使用成本。
本项目持续迭代更新,当前 v0.2.0 版本已引入多项核心功能,旨在为复杂的 AI 应用提供高性能、低延迟的缓存管理能力,支持多种后端存储模式以适应不同的业务场景。
运行本项目需要 Python ≥ 3.12 环境。核心依赖包括 `diskcache` 和 `numpy`,系统会自动完成安装。此外,若需运行适配器测试(adapter tests),可能需要安装额外的可选依赖项。
您可以通过多种方式进行安装:使用 `pip install` 从 PyPI 直接获取;或者通过 Git 克隆源码并使用 `uv sync --dev` 进行开发环境部署,以包含所有开发依赖。
项目提供了灵活的后端选择机制。根据您的应用场景(如是否涉及多进程、是否需要向量相似度检索或混合搜索),可以自主选择 `InMemoryBackend`、`RedisBackend` 或 `WeaviateBackend`。通过 `CacheManager` 和 `CacheKeyBuilder`,您可以轻松实现带命名空间的缓存读写操作。
可以通过环境变量对系统进行配置。支持通过 `OMNICACHE_BACKEND` 设置后端类型(如 `memory`、`disk` 或 `redis`),并可通过 `OMNICACHE_REDIS_URL` 指定 Redis 连接地址,或通过 `OMNICACHE_DISK_PATH` 定义磁盘缓存路径。
omnicache-ai 提供了强大的适配器支持,能够无缝接入主流 AI 框架。目前已支持 `autogen-agentchat 0.4+` 的新 API 以及 `OpenAI Agents SDK`,通过简单的 Adapter 封装,即可为现有的 Agent 实例赋予缓存能力。
项目采用了先进的 AI Agent 流水线架构。在完整的 AI Pipeline 中,缓存层位于适配器(Adapters)之后,通过“自适应语义层(Adaptive Semantic Layer)”与“语义层(Semantic Layer)”的协同工作,实现对查询的智能拦截,从而在保证语义准确性的同时最大化缓存命中率。
高效的AI缓存库,值得关注
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,AI缓存库 是一款质量良好的Agent工作流,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | omnicache-ai |
| 原始描述 | 开源AI工作流:Unified multi-layer caching library for AI/agent pipelines — LangChain, LangGrap。⭐24 · Python |
| Topics | AI缓存工作流 |
| GitHub | https://github.com/ashishpatel26/omnicache-ai |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-01 · 更新时间:2026-06-01 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端