This commit is contained in:
Harrison Chase
2025-03-10 18:21:55 -07:00
parent 4009231eac
commit 907a0eec15
2 changed files with 10 additions and 1 deletions
+8
View File
@@ -10,6 +10,9 @@ pip install langgraph-reflection
## Details
<div style="display: flex; align-items: flex-start; gap: 20px;">
<div>
This reflection agent uses two subagents:
- A "main" agent, which is the agent attempting to solve the users task
- A "critique" agent, which checks the main agents work and offers any critiques
@@ -22,7 +25,12 @@ The reflection agent has the following architecture:
- If the critique agent finds something to critique, then the main agent is called again
- If there is nothing to critique, then the overall reflection agent finishes
4. Repeat until the overall reflection agent finishes
</div>
<div>
<img src="langgraph-reflection.png" alt="Reflection Agent Architecture" width="100"/>
</div>
</div>
We make some assumptions about the graphs:
- The main agent should take as input a list of messages
+2 -1
View File
@@ -153,6 +153,8 @@ def create_graphs():
return create_reflection_graph(assistant_graph, judge_graph).compile()
reflection_app = create_graphs()
if __name__ == "__main__":
"""Run an example query through the reflection system."""
example_query = [
@@ -163,6 +165,5 @@ if __name__ == "__main__":
]
print("Running example with reflection...")
reflection_app = create_graphs()
result = reflection_app.invoke({"messages": example_query})
print("Result:", result)