Model Pipeline - LangChain agents overview
LangChain agents help computers decide what to do step-by-step by using tools and language understanding. They take input, think about it, use tools if needed, and give answers.
Jump into concepts and practice - no test required
LangChain agents help computers decide what to do step-by-step by using tools and language understanding. They take input, think about it, use tools if needed, and give answers.
Loss
1.0 | *
0.8 | **
0.6 | ***
0.4 | ****
0.2 | *****
+---------
Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.8 | 0.50 | Agent starts learning to choose correct tools |
| 2 | 0.6 | 0.65 | Agent improves tool selection and response quality |
| 3 | 0.4 | 0.80 | Agent reliably picks right tools and generates good answers |
| 4 | 0.3 | 0.88 | Agent fine-tunes reasoning and response clarity |
| 5 | 0.25 | 0.92 | Agent achieves strong performance in multi-step tasks |
from langchain.agents import Agent
llm = MockLLM(responses=["Answer 1"])
tools = [Tool(name="search", func=lambda x: "found info")]
agent = Agent(llm=llm, tools=tools)
result = agent.run("Find info about AI")
print(result)from langchain.agents import Agent
llm = SomeLLM()
tools = [Tool(name="calc", func=calculate)]
agent = Agent(llm, tools)
result = agent.run("Calculate 2+2")
print(result)