This system implements a micro-microservice architecture, and uses vuetify+langchain+local large model+local vector database to build a demonstration of the RAG system.
It mainly includes the following functions:
- Use local LLM for language translation
- Use local LLM for professional knowledge questions and answers
From the perspective of system architecture, this system consists of three parts: front-end, API gateway, and back-end service:

The front end is developed using vue3 and vuetify3. The script is mainly written using the Combined API. The main features include:
- User authentication based on
OAuth2.0andJWTstandards - Translation component
- Q&A chat component
The front-end code also includes common functions such as
local session management,request interceptioncommon modules,switch theme, and uses a lot ofveutify3controls.
API Gateway is implemented using FastAPI, and mainly implements the following functions:
- User authentication based on
OAuth2.0andJWTspecifications - Request proxy forwarding
Backend services mainly provide services based on the local LLM, including:
- Use the
Ollamaplatform to deploy and use theOllama3.1open source LLM locally - Use
Chromafor local vector data storage and retrieval - Use
Ollama3.1ornomic-embed-textfor vectorization - Use the local large language model
Ollama3.1to achieve enhanced generation - Use
langchianto integrate the above functions to provide services
- image/ The image directory used in the document
- src/ The source code directory
- backend/ The backend code
- gateway/ The API gateway
- common/ The common logic module
- config/ The configuration file
- util/ The tool class
- api gateway.py The gateway startup file
- start.bat The gateway startup batch file in the windows system, double-click to start the API gateway
- services/ Application services
- consulting/ Consulting service
- legal_consultation/ Legal advice service
- translation/ Translation service
- response.py API corresponding entity class
- start all.bat Windows batch file, run it to start the gateway and all services
- gateway/ The API gateway
- practice/ Python files for practice, each file implements a function independently
- webclient/ front-end vuetify code
- src/ source code directory
- ...
- backend/ The backend code
- It is recommended to use
Visual Studio Codeas the development tool, and usevenvto create a virtual environment in thebackendfolder. For detailed steps, see: Configure venv in Visual Studio Code
It is recommended to use
python 3.12.1or above
- Install dependencies
The gateway and each service are independent applications. After entering the
backenddirectory, go to thegatewayfolder and each subfolder ofservices, and execute the following command to install its runtime environment:
pip install -r requirements.txt-
Install
Ollamaand download the large language model to the local computer. Here you need to downloadllama3.1andnomic-embed-text
For detailed steps, please refer to: Use the locally deployed llama3.1 LLM in langchian -
Start all backend services
You can usebackend/start all.batto start the gateway and all services with one click. As shown below:

At this point, the backend service has been configured.
- It is still recommended to use
Visual Studio Codeto open the project.
If you are not familiar with usingVisual Studio Codeandveutify, it is recommended to take a look at: Use the fastest way to create a vuetify3 project
It is recommended to use
V18.20.5(LTS), and it is not recommended to use newer versions.
- Install node module
npm install- Start
pnpm run devor
npm run devIf you are not familiar with technologies such as langchain and RAG, we recommend that you refer to the following introductory tutorials:
🔗Building a RAG system of langchain+local large language model+local vector database from scratch
If you don't know vuetify, you can take a look at the following introductory tutorial:
🔗Veutify3 Getting Started
🪐Good luck🪐
