Content
# 📘 Project Feature Introduction: Intelligent Q&A System Based on Streamlit + DeepSeek + MCP Multi-Tool Integration
This project builds an intelligent Q&A system that integrates Document Q&A (RAG), external tool invocation (MCP Server), and conversational context memory. It allows users to interact with the model through a web page, perform complex tasks, and receive personalized responses.
## 🎯 Overview of Core Project Features
1. **Streamlit Frontend Interface Interaction**
A clean and intuitive chat interface built on Streamlit.
Supports uploading local documents (.txt, .pdf, .docx, .md) to create a private knowledge base.
Provides a sidebar button to clear conversation history for easy re-questioning.
2. **Document Q&A Functionality (RAG)**
Automatically parses and chunks uploaded documents, building a temporary vector database (Chroma).
Supports content retrieval from user-uploaded documents through the encapsulated CustomRetrieverTool.
The model generates accurate responses based on retrieval results and user questions, enabling private document Q&A functionality.
3. **MCP Server Multi-Tool Remote Invocation**
Supports connecting multiple external service tools via the MCP (Multi-Component Protocol) protocol, with default support for the following tools:
🗺️ Amap Maps (amap_maps)
🔎 Tavily Online Search (tavily)
📁 Local File System Access (filesystem)
🧠 Sequential Reasoning Tool (sequential_thinking)
🕒 Current Time Query (time)
Tool metadata is automatically loaded and recognized by the model, which will proactively invoke the corresponding tools to complete tasks when necessary.
All tool parameters and return results are automatically encapsulated and processed, simplifying development and maintenance.
4. **DeepSeek Large Model Invocation**
Connects to the DeepSeek model using the OpenAI API interface (requires setting DEEPSEEK_API_KEY, BASE_URL, and MODEL in .env).
Supports Function Calling to seamlessly collaborate with tools, automatically deciding whether to invoke tools based on tasks.
Supports injecting different system prompt templates to adapt to whether the document Q&A functionality (RAG) is enabled.
5. **Conversational Memory Management**
Integrates LangChain's ConversationBufferMemory and StreamlitChatMessageHistory to achieve continuous context memory.
Tracks historical conversations between the user and AI, serving as context reference when the model generates responses.
## 🧩 Environment and Configuration Instructions
The following content needs to be set in the .env file:
DEEPSEEK_API_KEY=<your-deepseek-api-key>
BASE_URL=https://api.deepseek.com
MODEL=deepseek-chat
AMAP_MAPS_SERVER_COMMAND=python
AMAP_MAPS_SERVER_ARGS=amap_server.py
AMAP_MAPS_SERVER_ENV=AMAP_API_KEY=your-key
TAVILY_SERVER_COMMAND=python
TAVILY_SERVER_ARGS=tavily_server.py
TAVILY_SERVER_ENV=TAVILY_API_KEY=your-token
# ... Other MCP tool configurations
## 📎 Usage Instructions
Configure the MCP Server tool services (ensure configurations and paths are correct).
Run `streamlit run app.py` to start the frontend Q&A interface.
Upload documents through the sidebar (optional).
Enter questions in the chat box to start chatting with AI and enjoy enhanced tool capabilities.
## ✅ Examples of Practical Scenarios Implemented
Query a summary of a specific data segment in the uploaded PDF report.
Invoke Amap Maps to return city coordinate information.
Search for current news online and summarize it.
Use the local file system to list directory files.
Automatically complete chain logic reasoning tasks.
To add more tool services, simply write an MCP-compatible server and add configurations in the .env file to dynamically register new tools, ensuring good scalability and modular design.
You Might Also Like
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

NextChat
NextChat is a light and fast AI assistant supporting Claude, DeepSeek, GPT4...

cherry-studio
Cherry Studio is a multilingual project for creative collaboration.
aws-lambda-mcp-cookbook
AWS Lambda MCP Cookbook provides Python examples for MCP server integration.
mcp-server-macos-use
MCP server in Swift for controlling macOS apps via accessibility APIs.
MonkeyMCP
MonkeyMCP is a .NET 9.0 server for Model Context Protocol facilitating...