Fufan-chat-api is an intelligent Q&A system for local knowledge bases developed using large model technologies. This system implements five core scenarios of large model application deployment: general domain knowledge Q&A with large models, local private knowledge base Q&A, real-time internet search Q&A, AI Agents Q&A, and large model recommendation systems. Additionally, the system includes a complete RAG evaluation scheme and process, and supports Docker container deployment, offering highly flexible and efficient application deployment options.
This project is a secondary development based on the 👉LangChain-chatchat v0.2 version, where the original architecture was optimized using a frontend-backend separation design. The backend is developed entirely in Python, while the frontend utilizes the modern Vue3 framework. The frontend repository that this project interfaces with is👉 fufan-chat-web
Video coming soon.............
FuFan-chat-api provides a comprehensive user registration and login mechanism, ensuring system security and a personalized experience for each user. The main features of this module include:
FuFan-chat-api is compatible with a variety of high-performance open-source large models and online large model APIs as base models. This system version primarily uses ChatGLM3-6b, glm-4-9b-chat, and the online GLM-4 API interface. It allows users to flexibly integrate other models according to their actual needs, supporting mainstream models such as OpenAI GPT, Qwen2, as well as integration frameworks like Vllm and Ollama.
We have utilized the 👉 FastChat open-source project framework to deploy models, optimizing support for the glm4-9b-chat model. Although the FastChat framework was initially not compatible with glm4-9b-chat, we have manually fixed issues including streaming output and self-ask self-answer loops. Now, the glm4-9b-chat model is fully functional and stable. For the specific architecture, see 👉 FastChat Service Startup Logic and 👉 FastChat Request Handling Logic.
To facilitate users to extend or test new models, we provide detailed code examples. Through these examples, users can understand how to integrate new models into the system, further enhancing the system’s functionality and flexibility.
The general knowledge Q&A feature of the FuFan-chat-api fully utilizes the native conversational capabilities of large models. This function is based directly on large models and is integrated with the LangChain application framework to create a unified large model conversation interface. It enhances the memory capabilities of large model sessions by reading historical dialogue records from the MySQL database for specified users and dialogue windows in real time. For the specific architecture, see 👉General Domain Knowledge Q&A Logic Diagram.
Building upon the general knowledge Q&A process, we have introduced functionality for loading and retrieving from local knowledge bases using RAG technology with large models to enhance the quality of Q&A. This feature allows integration of large models with private data, effectively addressing limitations in large model knowledge. For the specific architecture, see 👉 Local RAG Knowledge Q&A Development Logic.
We utilize Faiss for storing vector indexes, providing efficient retrieval capabilities for the system. The system is equipped with knowledge bases including millions of public Wiki corpora and private corpora (in PDF format), enhancing data breadth and depth. For the specific architecture, see 👉 Vector Database Integration Logic.
This feature integrates real-time online retrieval, a very mainstream large model application in AI search today. We ensure the efficiency and accuracy of information retrieval through more detailed process handling, which performs well even under domestic network conditions. For the specific architecture, see 👉 Online Real-Time Retrieval Q&A Logic.
This feature innovatively integrates large language models (LLMs) into the recommendation systems of the education industry to enhance the personalization and accuracy of recommendations. The system is specifically designed for the educational sector and includes the following key steps:
In the initial introduction of the Agent Q&A feature, the early version was tested based on LangChain-chatchat v0.2. The results did not meet our expectations, prompting us to decide on necessary optimizations and adjustments.
We are actively developing and testing new versions to provide a smoother and more intelligent Agent Q&A experience. Stay tuned for the release of our latest version, which is expected to significantly improve user interaction quality and system response speed.
pip install langchain-core==0.2.5, ignoring version dependency conflicts, and waiting for the official LangChain fix.Ensure the following software or services are installed and properly configured:
Clone the repository and install dependencies:
git clone https://github.com/fufankeji/fufan-chat-api.git
cd fufan-chat-api
pip install -r requirements.txt
Deploy and start the MySQL service locally:
Initialize the relational database tables:
python /fufan-chat-api/server/db/create_all_model.py
Initialize the Faiss vector database:
python /fufan-chat-api/server/knowledge_base/init_vs.py
Deploy and start the Milvus vector database locally (if required):
Start the backend service:
python startup.py
Request URL: http://{server_ip}:8000/docs
Using Postman or another HTTP client tool to access the API endpoint:
To make a POST request to your API, first ensure that you replace the placeholder URL with the actual IP address and port number where your service is running. Here's how you might structure the request using a generic example:
http://192.168.110.131:8000/api/chat
{
"query":"What is machine learning?",
"conversation_id":"18b352a0-42de-419c-ada1-a0fa44dbee1d",
"model_name":"chatglm3-6b"
}
We welcome contributions to the project via GitHub pull requests or issues. Any form of contribution is highly appreciated, including feature improvements, bug fixes, or documentation enhancements.化。
fufan_chat_api has launched version 1.0 and will continue to iterate and update. If you're interested, you're welcome to join our technical discussion group. For any other questions, scan to add Little Cute (WeChat: littlelion_1215) and reply with "RAG" for more details👇
Python
90.0%
Jupyter Notebook
9.2%
Fufan-chat-api is an intelligent Q&A system for local knowledge bases developed using large model technologies. This system implements five core scenarios of large model application deployment: general domain knowledge Q&A with large models, local private knowledge base Q&A, real-time internet search Q&A, AI Agents Q&A, and large model recommendation systems. Additionally, the system includes a complete RAG evaluation scheme and process, and supports Docker container deployment, offering highly flexible and efficient application deployment options.
This project is a secondary development based on the 👉LangChain-chatchat v0.2 version, where the original architecture was optimized using a frontend-backend separation design. The backend is developed entirely in Python, while the frontend utilizes the modern Vue3 framework. The frontend repository that this project interfaces with is👉 fufan-chat-web
Video coming soon.............
FuFan-chat-api provides a comprehensive user registration and login mechanism, ensuring system security and a personalized experience for each user. The main features of this module include:
FuFan-chat-api is compatible with a variety of high-performance open-source large models and online large model APIs as base models. This system version primarily uses ChatGLM3-6b, glm-4-9b-chat, and the online GLM-4 API interface. It allows users to flexibly integrate other models according to their actual needs, supporting mainstream models such as OpenAI GPT, Qwen2, as well as integration frameworks like Vllm and Ollama.
We have utilized the 👉 FastChat open-source project framework to deploy models, optimizing support for the glm4-9b-chat model. Although the FastChat framework was initially not compatible with glm4-9b-chat, we have manually fixed issues including streaming output and self-ask self-answer loops. Now, the glm4-9b-chat model is fully functional and stable. For the specific architecture, see 👉 FastChat Service Startup Logic and 👉 FastChat Request Handling Logic.
To facilitate users to extend or test new models, we provide detailed code examples. Through these examples, users can understand how to integrate new models into the system, further enhancing the system’s functionality and flexibility.
The general knowledge Q&A feature of the FuFan-chat-api fully utilizes the native conversational capabilities of large models. This function is based directly on large models and is integrated with the LangChain application framework to create a unified large model conversation interface. It enhances the memory capabilities of large model sessions by reading historical dialogue records from the MySQL database for specified users and dialogue windows in real time. For the specific architecture, see 👉General Domain Knowledge Q&A Logic Diagram.
Building upon the general knowledge Q&A process, we have introduced functionality for loading and retrieving from local knowledge bases using RAG technology with large models to enhance the quality of Q&A. This feature allows integration of large models with private data, effectively addressing limitations in large model knowledge. For the specific architecture, see 👉 Local RAG Knowledge Q&A Development Logic.
We utilize Faiss for storing vector indexes, providing efficient retrieval capabilities for the system. The system is equipped with knowledge bases including millions of public Wiki corpora and private corpora (in PDF format), enhancing data breadth and depth. For the specific architecture, see 👉 Vector Database Integration Logic.
This feature integrates real-time online retrieval, a very mainstream large model application in AI search today. We ensure the efficiency and accuracy of information retrieval through more detailed process handling, which performs well even under domestic network conditions. For the specific architecture, see 👉 Online Real-Time Retrieval Q&A Logic.
This feature innovatively integrates large language models (LLMs) into the recommendation systems of the education industry to enhance the personalization and accuracy of recommendations. The system is specifically designed for the educational sector and includes the following key steps:
In the initial introduction of the Agent Q&A feature, the early version was tested based on LangChain-chatchat v0.2. The results did not meet our expectations, prompting us to decide on necessary optimizations and adjustments.
We are actively developing and testing new versions to provide a smoother and more intelligent Agent Q&A experience. Stay tuned for the release of our latest version, which is expected to significantly improve user interaction quality and system response speed.
pip install langchain-core==0.2.5, ignoring version dependency conflicts, and waiting for the official LangChain fix.Ensure the following software or services are installed and properly configured:
Clone the repository and install dependencies:
git clone https://github.com/fufankeji/fufan-chat-api.git
cd fufan-chat-api
pip install -r requirements.txt
Deploy and start the MySQL service locally:
Initialize the relational database tables:
python /fufan-chat-api/server/db/create_all_model.py
Initialize the Faiss vector database:
python /fufan-chat-api/server/knowledge_base/init_vs.py
Deploy and start the Milvus vector database locally (if required):
Start the backend service:
python startup.py
Request URL: http://{server_ip}:8000/docs
Using Postman or another HTTP client tool to access the API endpoint:
To make a POST request to your API, first ensure that you replace the placeholder URL with the actual IP address and port number where your service is running. Here's how you might structure the request using a generic example:
http://192.168.110.131:8000/api/chat
{
"query":"What is machine learning?",
"conversation_id":"18b352a0-42de-419c-ada1-a0fa44dbee1d",
"model_name":"chatglm3-6b"
}
We welcome contributions to the project via GitHub pull requests or issues. Any form of contribution is highly appreciated, including feature improvements, bug fixes, or documentation enhancements.化。
fufan_chat_api has launched version 1.0 and will continue to iterate and update. If you're interested, you're welcome to join our technical discussion group. For any other questions, scan to add Little Cute (WeChat: littlelion_1215) and reply with "RAG" for more details👇
Python
90.0%
Jupyter Notebook
9.2%