Editing
AI Agents and Agentic Systems
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Building a simple ReAct agent with LangChain:''' <syntaxhighlight lang="python"> from langchain.agents import create_react_agent, AgentExecutor from langchain_openai import ChatOpenAI from langchain_community.tools import DuckDuckGoSearchRun from langchain_experimental.tools import PythonREPLTool from langchain import hub # Available tools tools = [ DuckDuckGoSearchRun(), PythonREPLTool() # Execute Python code in a sandbox ] # Load ReAct prompt template prompt = hub.pull("hwchase17/react") # LLM backbone llm = ChatOpenAI(model="gpt-4o", temperature=0) # Create agent agent = create_react_agent(llm, tools, prompt) # Executor handles the loop executor = AgentExecutor( agent=agent, tools=tools, verbose=True, # Print the reasoning trace max_iterations=10, # Prevent infinite loops handle_parsing_errors=True ) result = executor.invoke({ "input": "Find the top 3 trending AI papers from this week and summarize their key findings." }) print(result["output"]) </syntaxhighlight> ; Multi-agent patterns : '''Sequential''' β Agent A produces output β Agent B processes it β Agent C finalizes. Simple, predictable. : '''Parallel''' β Multiple agents work simultaneously on subtasks; results are aggregated. : '''Hierarchical''' β Orchestrator agent delegates to worker agents, reviews their outputs, and re-delegates if needed. : '''Debate''' β Two agents argue opposing positions; a judge agent synthesizes the best answer. </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information