Yagra Documentation

Declarative LangGraph Builder powered by YAML

Yagra enables you to build LangGraph’s StateGraph from YAML definitions, separating workflow logic from Python implementation.

What is Yagra?

Yagra is a Python library that lets you define LLM agent workflows declaratively in YAML files. Instead of writing boilerplate LangGraph code for every workflow variation, you define nodes, edges, and branching logic in YAML—then swap configurations without touching code.

Key Benefits

  • Faster iteration: Adjust workflows by editing YAML, not Python

  • Non-engineer friendly: Prompt engineers and domain experts can modify workflows

  • Validation by design: Pydantic-based schema catches errors before runtime

  • Visual editing: Studio WebUI for drag-and-drop workflow construction

  • AI-ready: JSON Schema export enables coding agents to generate workflows

Architecture Overview

Yagra follows Hexagonal Architecture (Ports and Adapters):

  • Domain: Core workflow entities (GraphSpec, NodeSpec, EdgeSpec)

  • Application: Use cases (build_state_graph, validate_workflow)

  • Ports: Interfaces for extensibility (NodeRegistryPort)

  • Adapters: Implementations (file system, WebUI server)

Dependency rule: Outer layers depend on inner layers, never the reverse.

Use Cases

  • Prototyping LLM agent flows: Rapidly test different workflow variations

  • Collaborative workflow development: Enable non-engineers to adjust prompts and branching

  • AI-assisted workflow generation: Let coding agents generate and validate workflows

  • Reducing boilerplate: Build complex LangGraph applications with less code

Community

License

MIT License - see LICENSE for details.