AI Office Assistant

AI Office Assistant

An AI-powered office assistant using LLM, RAG, and MCP tools to answer weather queries, retrieve information from documents, and automatically generate Excel and Word reports.

Category
Visit Server

README

AI Office Assistant

A beginner-friendly AI project using:

  • MCP (Model Context Protocol)
  • RAG (Retrieval-Augmented Generation)
  • Groq LLM
  • ChromaDB
  • Weather API
  • Excel Automation
  • Word Automation

Features

  • Ask weather questions
  • Query local PDF and DOCX documents
  • Automatically save weather results to Excel
  • Automatically generate Word reports
  • MCP tool calling

mcp-rag-office-assistant/ │ ├── app.py ├── requirements.txt ├── .env ├── .gitignore ├── README.md │ ├── data/ │ ├── pdfs/ │ ├── docs/ │ └── vector_db/ │ ├── outputs/ │ ├── excel/ │ └── word/ │ ├── config/ │ ├── init.py │ ├── settings.py │ └── logger.py │ ├── llm/ │ ├── init.py │ ├── groq_model.py │ └── prompt.py │ ├── rag/ │ ├── init.py │ ├── loader.py │ ├── splitter.py │ ├── embeddings.py │ ├── vector_store.py │ └── retriever.py │ ├── mcp_server/ │ ├── init.py │ ├── server.py │ ├── tools.py │ └── schemas.py │ ├── services/ │ ├── init.py │ ├── weather_service.py │ ├── excel_service.py │ └── word_service.py │

  1. LangChain

Purpose

  • Build LLM applications
  • Prompt Templates
  • Chains
  • Document handling
  • Retrieval

Prompt

↓

Retriever

↓

LLM

↓

Answer

  1. LangChain Community

User │ ▼ Groq LLM │ ├──────────────┐ ▼ ▼ MCP Tools RAG │ │ Weather API ChromaDB │ │ └──────┬───────┘ ▼ Final Answer │ ┌──────┴──────┐ ▼ ▼ Excel Word

Complete Architecture

                USER
                  │
                  ▼
             Groq LLM
                  │
          Tool Calling (MCP)
                  │
 ┌──────────┬─────────────┬─────────────┐
 ▼          ▼             ▼

Weather Excel Tool Word Tool │ │ │ ▼ ▼ ▼ OpenWeather Microsoft Microsoft API Excel Word │ │ ▼ ▼ Write Cells Write Report │ │ └──────┬──────┘ ▼ Save Documents

Then We'll Upgrade Even More

  • After Office automation, we'll add more desktop tools.

Desktop Agent

├── Weather Tool ├── Excel Automation ├── Word Automation ├── Open Chrome ├── Read PDF ├── Search Documents (RAG) ├── Take Screenshot ├── File Explorer ├── Calculator ├── Notepad ├── Send Email ├── Voice Input (Optional) └── OCR (Optional)

🤖 MCP RAG Office Assistant

An AI-powered Office Assistant built using LLM + RAG + Tool Calling + Office Automation.

The assistant can understand user requests, decide the required action, retrieve information from documents, call external tools, and automatically generate Microsoft Excel and Word reports.


🚀 Project Overview

Traditional applications require users to manually search documents, collect information, and create reports.

This project demonstrates an AI Agent workflow:

User Query
    |
    |
    v
LLM (Groq)
    |
    |
    +----------------------+
    |                      |
    v                      v
Weather Tool              RAG Pipeline
    |                      |
    |                      |
Weather API          Document Retrieval
                           |
                           |
                           v
                      ChromaDB
                           |
                           |
                           v
                       Context
                           |
                           |
                           v
                      Groq LLM
                      
                           
             |
             |
             v

       Office Automation

       +-------------+
       |             |
       v             v

    Excel        Microsoft Word


🎯 Project Objective

Build a beginner-level AI Agent system that demonstrates:

  • Large Language Model integration
  • Retrieval Augmented Generation (RAG)
  • Tool execution
  • MCP architecture concepts
  • Document understanding
  • Automated report generation
  • Desktop application automation

🧠 Technologies Used

Artificial Intelligence

Technology Purpose
Groq LLM Language model
LangChain LLM application framework
RAG Document question answering
ChromaDB Vector database
HuggingFace Embeddings Text embeddings

Backend

Technology Purpose
Python Programming language
PyWin32 Microsoft Office automation
Requests API calls
Logging Application monitoring

Office Automation

Application Usage
Microsoft Excel Generate reports
Microsoft Word Create documents

📂 Project Structure

mcp-rag-office-assistant/

│
├── app.py
│
├── config/
│   |
│   ├── settings.py
│   └── logger.py
│
│
├── llm/
│   |
│   ├── grok_model.py
│   └── prompt.py
│
│
├── rag/
│   |
│   ├── loader.py
│   ├── splitter.py
│   ├── embeddings.py
│   ├── vector_store.py
│   ├── retriever.py
│   └── rag_pipeline.py
│
│
├── services/
│   |
│   ├── weather_service.py
│   ├── excel_service.py
│   ├── word_service.py
│   └── office_agent.py
│
│
├── agent/
│   |
│   └── office_agent_executor.py
│
│
├── data/
│   |
│   ├── pdf/
│   |
│   └── docs/
│
│
├── vector_db/
│
│
├── outputs/
│   |
│   ├── excel/
│   |
│   └── word/
│
│
└── requirements.txt


⚙️ Installation

1. Clone Project

git clone <repository-url>

cd mcp-rag-office-assistant

2. Create Virtual Environment

python -m venv .venv

Activate:

Windows

.venv\Scripts\activate

3. Install Requirements

pip install -r requirements.txt

4. Environment Variables

Create:

.env

Add:

GROQ_API_KEY=your_api_key

🔑 Groq Configuration

The project uses:

llama-3.3-70b-versatile

Model configuration:

config/settings.py

Example:

LLM_MODEL="llama-3.3-70b-versatile"

📚 RAG Pipeline

The RAG system follows this architecture:

Documents

(PDF/DOCX)

     |
     v

Document Loader

     |
     v

Text Splitter

     |
     v

Embedding Model

     |
     v

Chroma Vector Database

     |
     v

Retriever

     |
     v

Groq LLM

     |
     v

Final Answer


📄 Supported Documents

Currently supported:

  • PDF
  • DOCX

Place files:

data/pdf/

data/docs/

Example:

data/pdf/company_policy.pdf

🔎 RAG Workflow Example

User:

What is the leave policy?

System:

  1. Searches company documents
  2. Retrieves relevant chunks
  3. Creates context
  4. Sends context + question to Groq
  5. Generates answer
  6. Creates Word report

Output:

outputs/word/

Company_Policy_Report.docx

🌦 Weather Tool

Example:

Weather Hyderabad

Workflow:

User

 |

 v

Weather Detection

 |

 v

Weather API

 |

 v

Excel Generator

 |

 v

Word Generator

Output:

outputs/

├── excel

│    └── Weather_Report.xlsx


└── word

     └── Weather_Report.docx


📊 Excel Automation

The project uses:

pywin32

to control Microsoft Excel.

Workflow:

Python

 |

 v

Open Excel Application

 |

 v

Create Workbook

 |

 v

Write Data

 |

 v

Save File

Example:

Generated Excel:

Weather_Report.xlsx

📝 Word Automation

The project automatically opens Microsoft Word.

Workflow:

Python

 |

 v

Open Word

 |

 v

Create Document

 |

 v

Insert Content

 |

 v

Save DOCX

Example:

Weather_Report.docx

🧩 MCP Architecture Concept

This project follows MCP principles.

AI Agent

    |

    |

    +----------------+

    |                |

    v                v

 Resources        Tools


Resources

Information sources:

Examples:

  • PDF files
  • DOCX files
  • Vector database

Tools

Actions:

Examples:

  • Weather API
  • Excel Writer
  • Word Writer

▶️ Running Project

Start:

python app.py

Example:

You : Weather Hyderabad

Output:

Weather report generated successfully

Excel:
outputs/excel/Weather_Report.xlsx

Word:
outputs/word/Weather_Report.docx

Example RAG:

You : Explain company leave policy

Output:

Company_Policy_Report.docx

🧪 Testing

Test RAG:

python test_rag.py

Expected:

RAG Pipeline Ready

Answer Generated

Documents Retrieved: 3

🛠 Future Enhancements

Planned improvements:

1. Streamlit Interface

Web UI:

User
 |
 v
Streamlit
 |
 v
AI Agent

2. Complete MCP Server

Add:

  • MCP Resources
  • MCP Tools
  • MCP Prompts

3. LangGraph Integration

Future workflow:

START

 |

Agent Node

 |

Decision Node

 |

Tool Node

 |

Response Node

 |

END


4. More Office Actions

Future tools:

  • Email generation
  • PowerPoint creation
  • Excel analysis
  • Meeting summary
  • Report generation

🎓 Learning Concepts Covered

This project teaches:

✅ LLM Applications
✅ Prompt Engineering
✅ LangChain
✅ RAG Architecture
✅ Embeddings
✅ Vector Databases
✅ Tool Calling
✅ AI Agents
✅ MCP Concepts
✅ Office Automation
✅ Production Project Structure


👨‍💻 Author

AI Engineering Learning Project

Built for understanding:

LLM + RAG + Agents + MCP + Automation

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured