Skip to main content

Architecture

Overview

In this project, we build a system that can search and answer questions about the code of laws in Vietnam. The system is built with Microservice Architecture to ensure the scalability and maintainability of the system. The system consists of 3 main components: Question Answering, Search Engine, and Summarization. The Question Answering component is responsible for answering questions about the code of laws in Vietnam. The Search Engine component is responsible for searching for information about the code of laws in Vietnam. The Summarization component is responsible for summarizing the content of the code of laws in Vietnam.

We use Langchain to build the Question Answering component. The Search Engine component is built with Haystack. The Data Processor component is built with Nestjs.

Base Architecture

Components

No.ComponentDescriptionTechnology
1Front End

Responsible for receiving user input and sending requests to the back end.

Reactjs + React Native
2API Gateway

Receives requests from the front end and sends requests to the back end.

Nestjs
3Auth ServiceAuthenticates users and generates access tokens.Nestjs
4Law ServiceProvides information about the code of laws in Vietnam.Nestjs
5Search ServiceSearches for information about the code of laws in Vietnam.Python + Haystack
6Chat ServiceAnswers questions about the code of laws in Vietnam.Nestjs + Langchain

Dataset and Model

We use the dataset of the code of laws in Vietnam from the Phap dien website and QPPL website. The dataset contains 1,000 articles of the code of laws in Vietnam. We use the GPT model to build the Question Answering component and the Deepset model to build the Search Engine component.