Skip to content
/ RAGlaw Public

RAGlaw is a Retrieval-Augmented Generation (RAG) system designed to interpret and respond to questions based on the Polish Penal Code. Designed to work in Azure Kubernetes Service.

Notifications You must be signed in to change notification settings

SURFLOU/RAGlaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAGlaw Project Documentation

version

Overview

RAGlaw is a Retrieval-Augmented Generation (RAG) system designed to interpret and respond to questions based on the Polish Penal Code. It uses the GPT-4o Mini language model to generate contextually relevant answers, with information retrieved from a vector database. The solution is fully containerized and deployed on Azure Kubernetes Service (AKS) for scalability and ease of maintenance.

ChatUI

Architecture

Application architecture

Main components

rag-api

The 'rag-api' is API written in FastAPI that is serving as a backend service for the RAG communication. It consists of one POST Endpoint that retrieves the relevant context in Milvus DB, feeds it into LLM and returns the LLM answer based on that context

frontend

The 'frontend' is streamlit application that communicates with the rag-api and provide user-friendly interface to chat with RAG model

ingesting

The 'ingesting' is Argo Workflows's workflow that chunks Polish's Penal Code, embedds it and stores the embeddings in Milvus Vector Database

kubernetes

Application is designed to run on kubernetes' pods

terraform

Azure Kubernetes Cluster (AKS) is deployed using terraform

Getting Started

Prerequisites

Deployment Steps

  1. Terraform Deployment

    • Navigate to the terraform directory.
    • Create terraform.tfvars file and assign values
      resource_group_name     = "law-rag-model-rg"
      resource_group_location = "West US"
      aks_name                = "law-rag-model-aks"
      dns_prefix              = "law-rag-model-dns"
      node_count              = 1
      vm_size                 = "Standard_B2s"
      os_disk_size_gb         = 32
      subscription_id         = "<YOUR_SUBSCRIPTION_ID>"
    • Initialize Terraform:
      terraform init
    • Apply the Terraform configuration to deploy the AKS cluster:
      terraform apply
  2. Application Deployment

    • Navigate to the deploy directory.
    • Use Helm to deploy the application:
      helm install <release-name> ./helm-chart
    • Alternatively, apply the Kubernetes YAML files:
      kubectl apply -f sample.yaml -n namespace

About

RAGlaw is a Retrieval-Augmented Generation (RAG) system designed to interpret and respond to questions based on the Polish Penal Code. Designed to work in Azure Kubernetes Service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published