Skip to content

Design Tradeoffs

Sudhanshu Shukla edited this page Nov 12, 2026 · 2 revisions

Design Tradeoffs

Isolated functions vs. one integrated platform

Each topic builds its own local graph and state classes. This is clear and avoids shared runtime infrastructure across examples.

State schema choices

  • TypedDict: concise lightweight contracts; runtime type validation is limited.
  • Pydantic: explicit constraints and validation, with some overhead.
  • Separate input/output/private schema channels: clearer boundary and less unnecessary output leakage.

Wrapper vs. direct subgraph

The wrapper pattern works across different parent/child schemas by mapping values. Direct subgraph composition avoids mapping but requires compatible shared state.

Message reducers

add_messages merges by message ID and supports replacement; naive list concatenation only appends. Correct reducers matter when extending to parallel branches.

Offline vs. hosted models

Most examples use deterministic local nodes to keep costs predictable. Optional ChatOpenAI integration teaches API invocation but introduces availability, cost, privacy and credential-management concerns.

Clone this wiki locally