Reasoning Patterns
Reasoning capabilities are exposed as reusable pattern implementations rather than prompt-only conventions.
Available patterns
ProposeCriticPattern- Iterative propose/critic refinement. - Background references: Self-Refine; Reflexion. Conceptual grounding only; behavior is defined by repository contracts and implementation.BeamSearchPattern- Generator + evaluator delegate orchestration withmax_depth,branch_factor, andbeam_widthcontrols. - Background references: Tree of Thoughts. Conceptual grounding only; this implementation uses framework-native step orchestration.RAGPattern- Retrieval-augmented reasoning with memory read/write workflow primitives. - Background references: Retrieval-Augmented Generation (RAG). Conceptual grounding only; this pattern composes retrieval and context injection at workflow level.
Beam search output
BeamSearchPattern returns:
{
"final_output": {
"best_candidate": {...},
"best_score": float,
},
"details": {
"explored_nodes": int,
"frontier_trace": [...],
},
"terminated_reason": str,
}
Examples
examples/patterns/beam_search.pyexamples/patterns/propose_critic.pyexamples/patterns/rag.py