This tutorial runs examples/frameworks/langgraph/agent.py. It uses LangChain’s create_agent, which builds a LangGraph agent, and langchain-mcp-adapters to load Kebivo’s MCP tools. The example has no knowledge source; add one before applying its reporting behavior to a real assistant.

Prerequisites

  1. Start Kebivo with the quickstart. Its MCP endpoint must be enabled.
  2. Create a project token with feedback:gap in the Project tokens section of the project page and copy it when shown.
  3. Install uv and use Python 3.10 or later. Run from the repository root. The script declares its LangChain, LangGraph and MCP adapter dependencies inline for uv run.

Check the connection

export KEBIVO_URL=http://127.0.0.1:8000
export KEBIVO_TOKEN='<PROJECT_TOKEN>'
uv run examples/frameworks/langgraph/agent.py --list-tools

KEBIVO_URL is the origin, not the /mcp URL. With a token that has feedback:gap, the documented local check returned:

{"tools": ["report_knowledge_gap"]}

The check makes no model call and submits no event. If it fails, verify that the server is ready, MCP is enabled, and the token belongs to an active project with feedback:gap. If you see a different tool list, MCP tool visibility explains why.

Ask a question

The documented model run used a local OpenAI-compatible Ollama server with qwen2.5:3b. Start Ollama and make that model available, then run:

export OPENAI_BASE_URL=http://127.0.0.1:11434/v1
export OPENAI_API_KEY=ollama
export MODEL=qwen2.5:3b
uv run examples/frameworks/langgraph/agent.py 'How do I reset my corporate VPN?'

The JSON output contains tool_calls and answer. Look for report_knowledge_gap in tool_calls, then find the question in Kebivo’s Inbox and open its group detail. The occurrence shows Reported via: mcp. The MCP tool’s accepted result means Kebivo stored the event and a pending processing job. Grouping, routing and delivery follow asynchronously; inspect Deliveries for the destination result.

The example defaults to hosted OpenAI gpt-5-mini when MODEL is unset. That path needs your own OPENAI_API_KEY and was not run in the documented check. See the example README for both model commands.

Adapt the pattern

MultiServerMCPClient uses streamable_http, {KEBIVO_URL}/mcp, and an Authorization: Bearer header. client.get_tools() loads the tools visible to that token; create_agent(model, tools, system_prompt=...) makes them available to the graph. The sample agent instructions describe when to report a gap. Keep the bearer token on the server and omit personal or secret data from reports.

An agent can answer without calling any tool. If every qualifying gap has to be recorded, call the REST API from application code. This example only reports knowledge gaps; corrections require explicit user input, a separate scope and human review. The MCP guide documents input limits and errors.

Verification scope

The example README records a local Kebivo check: --list-tools listed report_knowledge_gap, and an Ollama qwen2.5:3b model run called the tool and reached accepted. The hosted OpenAI default was not run.

Checked against repository commit 6e5be1a.