Add real LangGraph workflow implementation

- Proper StateGraph with compiled nodes
- Conditional edges for writing iteration
- Checkpoint memory for resumability
- Structured state with Pydantic
- Node_validate for cross-stage validation
- Writing loop with iterate/next logic
- Full end-to-end workflow

This is the rigorous LangGraph integration.
This commit is contained in:
2026-03-12 20:13:41 +00:00
parent 897498829b
commit babf0b593a
2 changed files with 755 additions and 2 deletions
+9 -2
View File
@@ -26,6 +26,8 @@ from opus_orchestrator.schemas import (
RawContent,
)
from opus_orchestrator.state import OpusState, create_initial_state
from opus_orchestrator.langgraph_workflow import OpusGraph, run_opus, OpusGraphState
from opus_orchestrator.frameworks import StoryFramework
__all__ = [
# Config
@@ -51,9 +53,14 @@ __all__ = [
"NonfictionWriterAgent",
"FactCheckerAgent",
"NonfictionEditorAgent",
# Main
# LangGraph
"OpusGraph",
"OpusGraphState",
"run_opus",
"StoryFramework",
# Main (legacy)
"OpusOrchestrator",
]
# Import orchestrator at bottom to avoid circular imports
# Import legacy orchestrator for backward compatibility
from opus_orchestrator.orchestrator import OpusOrchestrator