Skip to content

Dynamic tool loading based on conversation context via memory #688

@kovtcharov

Description

@kovtcharov

Problem

Current tool descriptions consume ~12K tokens (30 tools x ~400 tokens). On a 32K context model, that is 37% consumed by tool descriptions alone. Static compression is a hack.

Approach

Dynamically load tools based on conversation context using the memory system. Memory informs which tools to activate per session. Tools not relevant to the current conversation are not loaded into the prompt.

Design:

  • Tool registry supports lazy loading — tools registered but not included in prompt by default
  • Memory system tracks which tools the user frequently uses
  • Conversation context (topic, keywords) determines which tool categories to activate
  • Core tools (read_file, search, RAG) always loaded
  • Specialized tools (Playwright, MCP servers, shell) loaded on demand
  • Tool set can change mid-conversation as context evolves

Dependencies

Acceptance Criteria

  • Tool prompt reduced from ~12K to ~3-4K tokens in typical sessions
  • Relevant tools activated automatically based on conversation context
  • Core tools always available regardless of context
  • No degradation in tool selection accuracy
  • Memory tracks which tools user uses most frequently

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentconsumerBlocks consumer adoption — must ship for the v0.20.0 consumer launch windowdomain:agent-coreFramework, tools, registry, memory, skills, orchestrationenhancementNew feature or requestp0high priorityperformancePerformance-critical changesspec-readyIssue has implementation spec adequate for coding-agent assignmenttrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions