Documentation
¶
Overview ¶
@sk-task tool-caching#T4.2: comprehensive example with agent + Ollama
This example demonstrates tool result caching at two levels:
- Direct tool level: a slow tool wrapped with cache — compare miss vs hit latency
- Agent level: an agent with Cache:true uses the same tools; cache counters show savings
Requires Ollama running on localhost:11434 with a model pulled (e.g., gemma3:4b or llama3.2). The cache works with any LLM provider — Ollama is just the example.
Usage:
ollama pull gemma3:4b go run ./examples/features/tool-caching/
Click to show internal directories.
Click to hide internal directories.