Commit Graph

9 Commits

Author SHA1 Message Date
mrhavens 0aae4233ab Fix state return handling - support dict fallback 2026-03-12 23:19:29 +00:00
mrhavens ce77c6ede2 Integrate AutoGen critique into LangGraph workflow
- Add CritiqueCrew initialization in OpusGraph.__init__
- Add use_autogen flag to enable/disable
- Add critique_summary and critique_iterations to state
- Rewrite node_write_chapters with AutoGen critique loop
- Each chapter now gets multi-agent critique (LiteraryCritic, GenreExpert, StoryEditor)
- Iteration loop until approved or max iterations
- Full integration complete
2026-03-12 23:14:33 +00:00
mrhavens 774c4b1785 Fix LangGraph state decay - nodes return dicts, use stream_mode=values
Based on Gemini's analysis:
1. Nodes now return dicts instead of mutating state
2. run() uses stream_mode='values'
3. Falls back to get_state() from checkpointer
4. Uses model_copy() for Pydantic updates
2026-03-12 22:24:59 +00:00
mrhavens 53911136c1 Fix return bug - use invoke + stream fallback 2026-03-12 22:06:58 +00:00
mrhavens 710684a53f Debug state extraction 2026-03-12 21:50:22 +00:00
mrhavens a0175056bd Fix final state extraction for LangGraph 2026-03-12 21:11:11 +00:00
mrhavens 411c4c100d Fix LangGraph result handling - NOW WORKING
Full pipeline runs end-to-end:
- All 7 pre-writing stages (seed → scene descriptions)
- Style guide generation
- Chapter writing (3 chapters, 2,833 words tested)

Fixed result extraction from graph.stream().
2026-03-12 20:51:05 +00:00
mrhavens 9692c89214 Add sync LLM client for LangGraph compatibility
The main structure is in place. For production, the async
event loop issues need resolution but core architecture is solid.
2026-03-12 20:17:19 +00:00
mrhavens babf0b593a 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.
2026-03-12 20:13:41 +00:00