langchain - 💡(How to fix) Fix Feature: Support for non-probabilistic decision frameworks (hexagram state machines) in agent orchestration [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#36877Fetched 2026-04-19 15:03:59
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
1
Timeline (top)
closed ×1commented ×1labeled ×1
RAW_BUFFERClick to expand / collapse

Submission checklist

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Feature Description

I'd like to propose support for non-probabilistic decision frameworks in LangChain's agent orchestration — specifically, deterministic state machines inspired by I Ching hexagram mechanics.

Current approach: LangChain agents rely primarily on LLM-driven reasoning (ReAct, Plan-and-Execute, etc.) for decision-making.

Proposed extension: Allow pluggable decision backends that can combine LLM reasoning with deterministic state machines. For example:

  • Map system metrics to a 6-dimensional vector
  • Convert to a hexagram (64 possible states)
  • Use hexagram transitions to drive agent behavior deterministically
  • Fall back to LLM only when the state machine encounters ambiguity

This would enable auditable, traceable decision paths — you can explain exactly why an agent took each step.

Use Case

I built TaijiOS (https://github.com/yangfei222666-9/TaijiOS/tree/five-engines) — a working implementation with five engines:

  1. Situation Engine — 6D vector analysis + deadlock breaking
  2. Recovery Engine — 6-stage fault recovery state machine
  3. Swarm Engine — Multi-agent coordination with commander selection
  4. Learning Engine — Experience loop with weight decay
  5. Persona Layer — Yin-yang balanced team composition

Validated with 80-event end-to-end demo, zero errors.

Alternatives Considered

  1. Custom AgentExecutor subclass — works but doesn't integrate with LangChain's ecosystem
  2. LangGraph state machines — closest existing solution, but designed for LLM-driven transitions
  3. Pure LLM reasoning — loses determinism and auditability

Additional Context

Website: https://taijios.xyz Exam score: 83.6% on CozeAgent benchmark (top 21%)

Happy to contribute a PR if there's interest.

extent analysis

TL;DR

Implement a pluggable decision backend in LangChain's agent orchestration to support non-probabilistic decision frameworks, such as deterministic state machines inspired by I Ching hexagram mechanics.

Guidance

  • Investigate the LangChain API and documentation to determine the best approach for integrating a custom decision backend.
  • Consider creating a new AgentExecutor subclass or modifying the existing LangGraph state machines to support deterministic state machine transitions.
  • Evaluate the feasibility of combining LLM reasoning with deterministic state machines, and identify potential challenges or limitations.
  • Review the provided TaijiOS implementation and its five engines to understand how a similar solution could be integrated into LangChain.

Example

No explicit code example is provided, but the TaijiOS implementation on GitHub (https://github.com/yangfei222666-9/TaijiOS/tree/five-engines) can serve as a reference for designing a custom decision backend.

Notes

The proposed extension requires a deep understanding of LangChain's architecture and the potential interactions between LLM-driven reasoning and deterministic state machines. The feasibility of this feature request depends on the flexibility of LangChain's current implementation and the willingness of the maintainers to accept a significant architectural change.

Recommendation

Apply a workaround by creating a custom AgentExecutor subclass, as this approach has already been explored and shown to work, albeit without integration with LangChain's ecosystem. This allows for a more incremental and reversible change, which can be refined and improved upon later.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING