Examples#

Every example below is a runnable Jupyter notebook committed to the repository under examples/.

Flagship screencast#

  • screencast/research_agent/screencast.ipynb — four-way head-to-head (create_react_agent baseline vs. hand-wired StateGraph vs. LangGOAP vs. LangGOAP-under-disruption) with real OpenAI + Tavily costs and Tavily-key revocation as the climax.

Basics#

Short primers — each notebook exercises a single mechanic.

  • plan_visualization.ipynb — Mermaid, DOT, ASCII, and Gantt renderers over an A* → CSP plan.

  • nl_goal_interpreter.ipynb — Plain-English request → GoalSpec via any BaseChatModel.

  • create_goap_agent_quickstart.ipynb — The Layer A one-liner: LangChain tools + goal → compiled StateGraph.

  • termination_policies.ipynbMaxCostPolicy, MaxActionsPolicy, and FirstOfPolicy composition.

  • stuck_handlers.ipynbFunctionalStuckHandler and MulticastStuckHandler recovering planning failures.

  • typed_form_hitl.ipynb — Typed-form interrupt() with Pydantic validation on resume.

  • action_qos.ipynb — In-executor retry with ActionQos and exponential backoff.

Tutorials#

Complete end-to-end walkthroughs across three tiers of complexity.

Tier 1 — Primers

  1. directory_handler.ipynb — GOAP basics on a file-system world state.

  2. robot_navigation.ipynb — A* primer on a linear graph.

  3. hungry_agent.ipynb — Natural-language goal + cost-driven action selection.

  4. from_routing_graphs_to_goap.ipynb — Hand-wired LangGraph routing graph rewritten as a GOAP plan that absorbs runtime disruptions.

Tier 2 — Workflows and constraint optimization

  1. cloud_balancing.ipynb — VM bin-packing with the create_goap_agent one-liner.

  2. vehicle_routing.ipynb — Capacity-constrained routing with CSP temporal scheduling.

  3. nurse_rostering.ipynb — Shift assignment with HardSoftScore and skill matching.

  4. project_job_scheduling.ipynb — RCPSP with precedence constraints and makespan minimization.

  5. task_assigning.ipynb — Ticket routing with the fluent ConstraintBuilder.

  6. sql_query_agent.ipynb — Schema-explore → generate → test → refine loop using effect_validator.

  7. vulnerability_scanner.ipynb — Phased discovery with action blacklisting.

  8. cost_bounded_research_agent.ipynb — Token / USD budget enforced via MaxCostPolicy.

  9. personal_shopper_agent.ipynb — Utility-maximizing planning with UtilityStrategy and NirvanaGoal.

  10. scheduled_delivery_confirmer.ipynb — Typed-form HITL with Pydantic validation.

  11. deepagents_integration.ipynb — Embed a GoapGraph as a StructuredTool or Deep Agents subagent.

Tier 3 — Full-stack showcases

  1. deep_research_agent.ipynb — LLM-heavy research loop with StoreExecutionHistory and tracing.

  2. hierarchical_product_launch.ipynbMultiGoal sequential decomposition.

  3. content_builder_agent.ipynb — Multi-objective CSP with conditional format generation.

  4. temporal_match_cellar.ipynb — Durative actions with overlap constraints and parallel scheduling.

  5. flexible_job_shop.ipynb — Every v0.1.0 feature in one notebook.

  6. supply_chain_disruption_mediator.ipynb — Stuck handlers and goal relaxation under cascading disruption.

  7. code_review_agent_mcp_deployment.ipynblanggoap deploy-init scaffolds a langgraph dev-ready deployment with an /mcp endpoint.