tensorone logo

Research

Graphs and Finite State Machines

We use graph structures and finite state machines (FSMs) as the foundation for modeling agent behavior, decision flow, and error recovery logic in complex environments.

By combining declarative transitions with graph traversal patterns, we enable agents to operate in predictable, auditable, and dynamic execution flows.


Why Graphs and FSMs?

While transformers generate text, they don’t inherently “know” what state they’re in or what step comes next. Graphs and FSMs fill that gap by providing:

  • Deterministic execution flows
  • Recovery checkpoints
  • Branching logic with guards
  • Transparency in decision paths

This allows us to build agents that are not only intelligent—but structured.


Key Concepts

Finite State Machines (FSM)

An FSM defines:

  • A set of states (e.g. idle, plan, act, verify)
  • A set of transitions with triggers
  • Guards or conditions for transitions
  • Optional entry/exit hooks for each state

This pattern allows an agent to move step-by-step through a controlled flow. FSMs are useful for:

  • Prompt validation
  • Multi-phase reasoning
  • Task lifecycle control

Directed Graphs

We also model reasoning and delegation flows as directed acyclic graphs (DAGs):

Start → Plan → Research → Validate → Summarize → End
                    ↘︎ ↘︎
                  Critic  Fallback

This lets agents dynamically select sub-paths, run agents in parallel branches, or backtrack when needed.


Example: Research Pipeline Graph

graph TD
    A[Start] --> B[Planner]
    B --> C[Researcher]
    C --> D[Critic]
    D --> E[Summarizer]
    D --> F[Replan?]
    F --> B
    E --> G[Finish]

Agents use this graph to determine their next action based on internal state, message results, and success conditions.


Tools and Frameworks

We build FSMs and graphs using:

  • LangGraph – Graph execution over LangChain chains
  • CrewAI + state modules – For planning and delegation within fixed flows
  • Custom graph compiler – Converts YAML definitions to live runtime FSMs
  • Eval hooks – Trace every node and transition for monitoring

Research Goals

We're currently exploring:

  • Self-modifying graphs: Agents that can restructure their own FSM based on outcomes
  • Heuristic triggers: Transition conditions informed by LLM uncertainty scores
  • State compression: Mapping long history chains into reusable graph checkpoints
  • Hybrid FSM × reactive agents: Combining deterministic flows with reactive policies

Why It Matters

In complex systems, how decisions are made matters as much as what decisions are made. Graphs and FSMs allow us to:

  • Test and simulate agent behavior
  • Visualize reasoning paths
  • Debug misaligned outputs
  • Enforce policy and structure

They are the cognitive scaffolding that lets LLMs move from raw token generation to reliable systems reasoning.


Previous
Agent2Agent (A2A) Protocol