Skip to content

perf(planner): add tool description compressor with Redis cache (#5065)#5822

Merged
mrveiss merged 1 commit intoDev_new_guifrom
issue-5065
Apr 24, 2026
Merged

perf(planner): add tool description compressor with Redis cache (#5065)#5822
mrveiss merged 1 commit intoDev_new_guifrom
issue-5065

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 24, 2026

Summary

  • New autobot-backend/tools/description_compressor.py with compress_description(tool_name, tool_spec):
    • Cache-first via Redis: tool_desc:{name}:{sha256_16} key, 30-day TTL
    • Compresses via Ollama POST /api/generate using config.ollama_url + config.llm.system_model
    • Falls back to raw description string on Ollama/Redis failure (never raises)
  • Extended ToolRegistry.get_compressed_descriptions() — gathers all tools concurrently via asyncio.gather

Test Plan

  • python -m py_compile autobot-backend/tools/description_compressor.py passes
  • python -m py_compile autobot-backend/tools/tool_registry.py passes
  • Redis unavailable → fallback returns original description without error
  • Cache hit avoids Ollama call on second invocation

Closes #5065

🤖 Generated with Claude Code

New module autobot-backend/tools/description_compressor.py:
- compress_description(tool_name, tool_spec) — async; cache-first via Redis
- SHA-256 keyed cache (tool_desc:{name}:{hash16}), 30-day TTL
- Ollama POST to config.ollama_url/api/generate for compression
- Falls back to raw description on any failure

Extended ToolRegistry.get_compressed_descriptions() — gathers all tools
concurrently via asyncio.gather.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant