RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /LangGraph for Local Agents
  6. /Ch. 12
LangGraph for Local Agents

12. Agent Communication

Chapter 12 of 18 · 15 min
KEY INSIGHT

All agent communication flows through shared state. Structured fields (`findings`, `generated_code`) beat a raw message history for cross-agent data passing because they are self-documenting and easy to read without parsing conversational text.

Agents in a LangGraph team communicate exclusively through shared state—not through function call arguments, not through shared globals, not through message queues. The shared state dict serves as an inbox, an outbox, and a persistent memory layer simultaneously. This design makes the graph introspectable: at any checkpoint, the full history of agent interactions is present in the state dict.

Tool results from workers are stored in the messages field (using Annotated[list, add]). This history can grow large on long runs. Strategies to manage it: truncate old messages periodically (via a custom reducer that keeps only the last N), or move agent outputs into named fields (worker_results, findings, generated_code) once a worker completes so the messages list stays focused on the current turn.

For cross-worker data passing—e.g., the researcher produces findings that the coder uses—store the findings in a structured field:

class TeamState(TypedDict):
    task: str
    findings: Annotated[list[str], add]
    generated_code: str | None
    messages: Annotated[list[BaseMessage], add]

The coder worker reads state["findings"] in its context and writes to state["generated_code"]. No additional IPC is needed.

Between-team communication (e.g., one team produces a report that another team uses as input) happens at the process level: one team graph writes its final state to disk or a database, and the next team reads from that source on its initial invoke.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Run two sequential worker calls where the first appends to findings and the second reads from it. Confirm the second worker can access the first worker's output without any side-channel communication.

← Chapter 11
Specialized Worker Agents
Chapter 13 →
Subgraphs