Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Planner AI with MCP Server

🚀 Overview

An AI-powered learning plan generator that takes a user's topic of interest and produces a structured, beginner-friendly learning plan by combining:

  • Multi-agent orchestration using LangGraph
  • Tool calling via MCP (Model Context Protocol)
  • Real-time web search (DuckDuckGo)
  • Vector database search (pgvector)
  • Local LLM inference using Ollama (Llama3)

🧠 How It Works

🔄 Flow

User Query
   ↓
Planner Agent (breaks query into research steps)
   ↓
Research Agent (decides web_search or vector_search per step)
   ├──→ web_search (DuckDuckGo via MCP)
   └──→ vector_search (pgvector via MCP)
   ↓
Organizer Agent (generates structured learning plan)
   ↓
Final Learning Plan

🧩 Agents

Planner Agent

  • Takes the user's raw query
  • Uses Llama3 to break it into 3-5 specific research steps
  • Populates steps in the agent state

Research Agent

  • Iterates over each research step
  • Uses Llama3 to decide which tool fits each step (web_search or vector_search)
  • Calls the chosen tool via MCP session
  • Populates context in the agent state

Organizer Agent

  • Combines all gathered context
  • Uses Llama3 to generate a clear, structured, beginner-friendly learning plan
  • Populates final in the agent state

🏗️ Tech Stack

Layer Technology
Backend FastAPI, LangGraph
LLM Ollama (Llama3)
Tool Server MCP (FastMCP)
Database PostgreSQL + pgvector
Web Search DuckDuckGo (duckduckgo-search)
Infrastructure Docker, Docker Compose

⚙️ Setup

git clone <repo-url>
cd <project-folder>
docker-compose up -d --build

⚠️ First startup takes a few minutes — Ollama needs to pull and warm up the Llama3 model before other services start.


🔎 API

POST /plan

Request:

POST /plan?query=How do I learn Python?

Response:

{
  "query": "How do I learn Python?",
  "steps": ["...", "..."],
  "context": ["...", "..."],
  "final": "Step 1: ..."
}

📂 Project Structure

app/
 ├── main.py
 ├── graph.py
 ├── state.py
 └── agents/
      ├── planner.py
      ├── researcher.py
      └── organizer.py
mcp_server/
 ├── server.py
 ├── db.py
 └── mcp_client.py
docker-compose.yml

🧠 Summary

The system takes a user's learning topic, breaks it into focused research steps using Llama3, gathers relevant information from both the web and a local knowledge base via MCP tools, and produces a structured step-by-step learning plan — all orchestrated through a multi-agent LangGraph workflow running entirely on local infrastructure.

About

Planner AI that generates learning plans with multiple agents and a MCP server

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages