Phase 3 — Agentic capabilities and MCP integration
Status: Planned
Phase 3 extends Alan with richer tool use and exposes it as an MCP server so external AI agents can query the knowledge graph.
Extended tool library
Phase 3 will add higher-level tools that go beyond single-hop retrieval:
| Tool (planned) | Description |
|---|---|
find_path | Find the shortest path between two nodes in the graph |
expand_neighborhood | Return all neighbors of a node up to N hops |
aggregate_subgraph | Run aggregations over a subgraph matching a pattern |
compare_nodes | Compare properties and connections of two or more nodes |
summarise_cluster | Summarise a cluster of related nodes using the LLM |
These tools will be added to chat-agent/tools/ following the same pattern as existing tools — each new tool requires only a schema dict and an async function registered in TOOL_MAP.
Multi-step planning
Phase 3 will introduce an optional planner step before the agentic loop: the LLM produces a step-by-step plan for complex questions before executing it. This reduces unnecessary tool calls and improves answer quality on multi-hop questions.
MCP server
Phase 3 will expose Alan as a Model Context Protocol (MCP) server, allowing external AI agents (Claude Desktop, OpenAI Agents, etc.) to use the knowledge graph as a tool.
The MCP server will expose:
| Resource / Tool | Description |
|---|---|
vector_search | Semantic similarity search over the indexed graph |
graph_query | Execute a Cypher query and return results |
get_schema | Return the graph skeleton as a structured resource |
get_node | Fetch a single node by ID with its properties and neighbors |
The FastAPI server already has an /mcp_tools/ route stub from Phase 1. Phase 3 will complete this implementation using the MCP Python SDK.
Evaluation framework
Phase 3 will add a lightweight evaluation harness to measure retrieval quality and answer accuracy across a curated set of test questions. This makes it possible to compare retrieval strategies (Phase 2 improvements) and tool combinations (Phase 3) objectively.
Metrics:
- Retrieval recall@k — does the top-k vector search include the ground-truth node?
- Answer correctness — LLM-as-judge comparison against reference answers
- Tool call efficiency — how many tool calls does the agent use per question?