Memory Consolidation, Orchestration Scripts, and State-Aware Control

Memory Consolidation, Orchestration Scripts, and State-Aware Control

Jul 3, 20263 min read

Agents are solving harder problems at scale, and the infrastructure is catching up. This week's posts cover memory systems that compress experience into reusable knowledge, orchestration patterns that dispatch hundreds of subagents programmatically, and harnesses that adapt agent behavior in real time based on conversation state.

Elastic Open-Sources Atlas Agent Memory Based on Cognitive Science

Atlas tackles the context window problem by maintaining three memory types inspired by cognitive science: episodic (specific interactions), semantic (general truths), and procedural (proven patterns). Instead of cramming entire histories into prompts, it uses hybrid search over Elasticsearch to retrieve relevant memories, then consolidates episodic traces into durable semantic facts and procedural playbooks using LLMs. The 0.89 Recall@10 benchmark on question-answering tasks suggests this approach actually works for production retrieval.

// Atlas memory retrieval via MCP
const relevantMemories = await atlas.search({
  query: "user preferences for API design",
  types: ["semantic", "procedural"],
  limit: 10
});
// Returns consolidated facts and playbooks, not raw conversation logs

Introducing Dynamic Subagents in Deep Agents

LangChain's dynamic subagents let the main agent write JavaScript orchestration scripts that dispatch hundreds of subagents using loops, branching, and concurrency instead of making sequential tool calls. This is the difference between "call subagent A, then subagent B" and "for each of 300 pages, spawn a subagent in parallel, then aggregate results." The six orchestration patterns (classify-and-act, fanout-and-synthesize, adversarial verification, generate-and-filter, tournament, loop-until-done) provide deterministic coverage for tasks that previously required unreliable turn-by-turn reasoning.

How Candidly Built State-Aware Agent Harnesses with LangSmith

Candidly built a harness that predicts conversation outcomes mid-conversation by classifying user engagement into four states (Engaged, Detailed, Guided, Disengaging) using deterministic features from LangSmith traces. They wired an Input-Output Hidden Markov Model into their agent's runtime to trigger state-specific response policies, cutting disengaging conversations in half. This is evaluation data converted into a live control signal, which is the right way to close the loop between observability and agent behavior.

Introducing OpenWiki, an open source agent for repo documentation

OpenWiki generates and maintains documentation wikis specifically for AI coding agents to query at runtime, avoiding the problem of bloated AGENTS.md files. The GitHub Action keeps the wiki synchronized with code changes, and the tool supports multiple model providers with LangSmith tracing built in.

# .github/workflows/openwiki.yml
- name: Update repo wiki
  run: npx openwiki generate --output wiki/ --trace

How to Use RLMs in Deep Agents

Recursive Language Models use code-based orchestration to avoid context rot, handling inputs up to 100x larger than the model's context window by dispatching subagents programmatically. The OOLONG benchmark shows this approach nearly doubles performance at 128k token contexts (0.79 vs 0.44) compared to plain agents, especially for tasks requiring comprehensive data aggregation. The pattern is now supported in Deep Agents through dynamic subagents and a QuickJS interpreter.

The common thread: agents need infrastructure that works at database scale (memory), orchestration that's deterministic and parallelizable (subagents), and harnesses that adapt to live signals (state-aware policies). These posts show what production-ready agent systems actually look like. 🛠️