Fix Agent Runtime: Tools, Memory, Permissions& Multi-Agent Support

Building reliable AI agents often hits three practical walls: memory that vanishes when a session ends, context windows that choke on long conversations, and the overhead of scaling complex tasks across multiple steps or teammates. A fourth pain point is the friction of moving from a safe prototype to a live model without rewiring the whole system.

OpenHarness tackles these issues with a plug‑and‑play harness that keeps the core loop unchanged while swapping in the needed capabilities. Persistent memory is handled by a lightweight MemoryStore that writes to a simple file (MEMORY.md). At the start of each new session the agent reads that file and injects its contents into the system prompt, so preferences, facts, or instructions survive across runs without any extra code.

When a dialogue grows beyond the model’s token limit, the harness runs an automatic compaction step. It summarizes the middle of the transcript into a concise note, preserves the original task and the most recent turns, and feeds the compacted view back into the loop. This lets agents run for hours or days without hitting a context window error, and the compaction threshold can be tuned to the specific model’s limits.

For tasks that benefit from parallel work—research, data gathering, code review—the same engine can spawn sub‑agents as ordinary tools. Each sub‑agent gets its own isolated brain, registry, and context, yet they share the same VFS, memory, and skill library. The lead agent waits for the results via asyncio.gather, then a synthesizer agent merges the findings. This nesting turns any tool call into a full agent, enabling true multi‑agent teams with minimal boilerplate.

Finally, switching from a deterministic mock brain to a real LLM provider requires only setting a few environment variables and constructing the appropriate brain object. The engine, tools, permissions, hooks, memory, and coordination logic stay exactly the same, proving the harness’s core promise: the model is pluggable, the rest is stable.

#AI #Product #MachineLearning #LLM #Automation #DevTools