|
2 | 2 | sidebar_position: 6
|
3 | 3 | ---
|
4 | 4 |
|
| 5 | +import ReactPlayer from 'react-player' |
| 6 | + |
5 | 7 | # Langfuse
|
6 | 8 |
|
7 | 9 | > Traces, evals, prompt management and metrics to debug and improve your LLM application.
|
8 | 10 |
|
9 | 11 | Learn more [here](https://langfuse.com/)
|
10 | 12 |
|
11 | 13 | [](https://github.com/langfuse/langfuse)
|
| 14 | + |
| 15 | +## Video Demos |
| 16 | + |
| 17 | +Below is an outline of the steps involved in a simple Math Agent. Key elements illustrated include: |
| 18 | + |
| 19 | +- A visual breakdown of each step—e.g., when the agent invokes a tool and when control returns to the agent |
| 20 | +- Inputs and outputs at each stage of the process: |
| 21 | + - **User to Agent**: The user asks a natural language question — e.g., `What is 1 + 1?` |
| 22 | + - **Agent to Tool**: The agent decides to call a calculator tool with structured arguments — e.g., `args: { a: 1, b: 1 }`. |
| 23 | + - **Tool to Agent**: The tool executes the operation and returns the result — e.g., `2`. |
| 24 | + - **Agent to User**: The agent responds with the final answer in natural language — e.g., `1 + 1 = 2`. |
| 25 | +- The full chat history throughout the interaction |
| 26 | +- Latency and cost associated with each node |
| 27 | + |
| 28 | +### Step 1: Math Agent (User to Agent → Agent to Tool) |
| 29 | + |
| 30 | +<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/langfuse/timeline-1-agent.mp4' /> |
| 31 | + |
| 32 | +<br /> |
| 33 | + |
| 34 | +This section shows: |
| 35 | + |
| 36 | +- **User to Agent**: The user asks a natural language question — e.g., `What is 1 + 1?` |
| 37 | +- **Agent to Tool**: The agent decides to call a calculator tool with structured arguments — e.g., `args: { a: 1, b: 1 }`. |
| 38 | +- **Full Chat History Throughout the Interaction**: You can inspect earlier user-agent messages. For instance: |
| 39 | + |
| 40 | +```text |
| 41 | +User: reply only no |
| 42 | +Agent: No. |
| 43 | +``` |
| 44 | + |
| 45 | +In this example, the agent responded directly without calling any tools. |
| 46 | + |
| 47 | +### Step 2: Tool Call (Tool to Agent) |
| 48 | + |
| 49 | +<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/langfuse/timeline-2-tool-call.mp4' /> |
| 50 | + |
| 51 | +<br /> |
| 52 | + |
| 53 | +This section shows: |
| 54 | + |
| 55 | + - **Tool to Agent**: The tool executes the operation and returns the result — e.g., `2`. |
| 56 | + |
| 57 | +### Step 3: Math Agent (Agent to User) |
| 58 | + |
| 59 | +<ReactPlayer playing controls url='/vid/fastapi-mcp-langgraph-template/langfuse/timeline-3-agent.mp4' /> |
| 60 | + |
| 61 | +<br /> |
| 62 | + |
| 63 | +This section shows: |
| 64 | + |
| 65 | + - **Agent to User**: The agent responds with the final answer in natural language — e.g., `1 + 1 = 2`. |
0 commit comments