Briefing

Home‑Rolled Agent Loop with Qwen3.5‑9B Uses Map‑Reduce and Structured Outputs to Reduce Human Bottleneck

ai-dev
by /u/DeltaSqueezer · Claude

Build a home‑rolled agent loop with map‑reduce task splitting and structured outputs to keep local Qwen3.5‑9B running efficiently.

What to do now

Implement a map‑reduce task splitter and structured output enforcement in your local agent loop to keep Qwen3.5‑9B efficient.

Summary

A home‑rolled agent loop built around Qwen3.5‑9B has proven surprisingly effective, but after 28 days of use the agent often idles waiting for human approvals, revealing a bottleneck. The model’s limited context window forces a map‑reduce pattern that breaks tasks into smaller chunks, allowing parallel execution while staying within the 9‑k token limit. Structured outputs are enforced to reduce LLM variability and enable a smooth reduce step, and a database tracks workflow progress, checkpoints, and recovery. The agent loop was wrapped into a skill that can be invoked with a single instruction, automating workflow creation with deterministic Python guardrails.

The agent has replaced Claude Code for 99 % of tasks, with the remaining 1 % handled by Claude during development roll‑backs. The loop is not yet released, but the author plans to open‑source it in the future. The primary limitation remains the human bottleneck, as approvals and reviews slow overall throughput. The approach demonstrates that small local models can manage complex workflows when combined with task‑splitting and structured outputs.

Key changes

  • Home‑rolled agent loop uses Qwen3.5‑9B
  • Map‑reduce pattern splits tasks into smaller chunks
  • Structured outputs reduce variability and enable smooth reduce
  • Database monitors workflows, checkpoints, recovery
  • Agent replaced Claude Code 99 % of tasks
  • Human approvals remain the bottleneck
  • Agent loop wrapped into a skill for single‑instruction invocation
  • Not yet released; plans to open‑source

Affects

internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting