Build a fact finder agent with code
Copy page
Overview
In this tutorial, you'll build a fact finder agent using code and the Inkeep SDK. When you ask "What is Inkeep?", the agent will:
- Search your knowledge base using the Inkeep RAG MCP tool
- Present relevant facts about Inkeep
Video walkthrough available
Follow along with our visual guide to see each step in action.
Prerequisites
- An existing Inkeep project running (follow the quick start guide to get started)
- Or access to Inkeep Cloud
Setting up the project
Step 1: Create the project directory
Navigate to your projects directory:
Create a new directory for your fact finder project:
Navigate into the new directory:
Step 2: Create the project configuration
Create an index.ts file with the following content:
Replace the placeholder values (<project-id>, <project-name>, <model-name>) with your actual project details. If you need help recreating the boilderplate, you can reuse the index.ts file from the default activities planner project.
Step 3: Push the project to Visual Builder
From the fact-finder directory, run:
Verify in the Visual Builder that the project is created successfully.
Creating the agent
Step 1: Create the agent directory
Step 2: Create the fact finder agent
Create agents/fact-finder-agent.ts with the following content:
Adding the MCP tool
Step 1: Create the tools directory
Step 2: Create the Inkeep RAG MCP tool
Create tools/inkeep-rag-mcp.ts with the following content:
This tool enables your agent to search your Inkeep knowledge base for relevant information, leveraging Inkeep Unified Search's RAG capabilities to provide accurate and relevant results.
Inkeep Unified Search is part of Inkeep's Enterprise offering. Connect 25+ data sources to create a unified knowledge base that your agents can access.
Step 3: Register the fact finder agent and rag mcp tool in the project
Deploying your agent
From the fact-finder directory, run:
Verify in the Visual Builder that the fact finder agent is created successfully.
Testing your agent
In the Visual Builder, click the Try it button to open the chat interface.
Test your agent by asking questions like:
- "What is Inkeep?"
- "Tell me about Inkeep's features"
- "How does Inkeep work?"
When working correctly, the agent will search your knowledge base and present relevant facts about Inkeep.