🏗️ SoRag System Architecture Documentation

Enterprise RAG SaaS Platform - Complete Architecture Visualization

Generated: 2025-09-30
Version: v1.0.0
Total Diagrams: 18 diagrams
PNG Success Rate: 13/13 (100%)
🛠️

Tech Stack

Backend (SoRag)

  • FastAPI 0.104.1 - Web framework
  • LangGraph 0.2.50 - Workflow orchestration
  • LangSmith 0.3.45 - Observability
  • SQLAlchemy 2.0.23 - ORM
  • PostgreSQL - Primary database
  • FAISS 1.7.4 - Dense vectors
  • Elasticsearch 8.11.0 - Sparse vectors
  • Redis 5.0.1 - Cache/Memory

Frontend (RagChat)

  • Next.js 15.3.0 - React framework
  • React 19.0.0 - UI library
  • TypeScript 5.6.3 - Type system
  • Vercel AI SDK 5.0.26 - AI integration
  • Radix UI - Accessible components
  • Tailwind CSS 4.1.13 - Styling
  • Drizzle ORM 0.34.0 - Database

Admin (AosoRag)

  • ABP.io Framework - DDD framework
  • .NET Core - Backend
  • Entity Framework - ORM
  • Angular/Blazor - Frontend

LLM Providers

  • OpenAI GPT-4
  • Anthropic Claude
  • Ollama (Local)
📋

Architecture Features

✅ LangGraph Workflows

  • Observability - LangSmith full-chain tracing
  • Maintainability - Node-based design
  • Recoverability - Checkpointer support
  • Testability - Independent node testing

✅ Multi-Agent Architecture

  • Specialization - RAG/Chat/Integration separation
  • Parallelization - asyncio.gather concurrency
  • Extensibility - Registry mechanism
  • Isolation - Independent compilation

✅ Multi-Tenant Architecture

  • Automation - ContextVars + event listeners
  • Security - Database-level auto-filtering
  • Flexibility - Context Manager switching
  • Performance - Index optimization

✅ DDD Design Principles

  • Layered architecture - 4 clear layers
  • Repository pattern - Data access abstraction
  • Entity handles business logic
  • Based on ABP.io principles
🎯

High-Level Overview

This section provides simplified, high-level architecture diagrams that show the overall system structure without implementation details. These diagrams are perfect for:

  • Executive Presentations - Quick understanding of system architecture
  • Onboarding - New team members getting familiar with the system
  • Architecture Reviews - High-level discussions without technical details
  • Client Demos - Showcasing system capabilities and structure

System Overview

High-level architecture components

System Overview - High-level architecture components

Component Architecture

Main system components

Component Architecture - Main system components

Data Flow Overview

Simplified flows

Data Flow Overview - Simplified flows

Technology Stack

Key technologies

Technology Stack - Key technologies

Deployment Architecture

Infrastructure

Deployment Architecture - Infrastructure
🏗️

System Architecture

Overall System Architecture

AosoRag Admin + SoRag Backend + RagChat Frontend

Overall System Architecture - AosoRag Admin + SoRag Backend + RagChat Frontend
🎯

Ddd Architecture

DDD 4-Layer Architecture

Python implementation based on ABP.io principles

DDD 4-Layer Architecture - Python implementation based on ABP.io principles
📥

Indexing

Indexing Workflow

LangGraph orchestrated 6-step pipeline

Indexing Workflow - LangGraph orchestrated 6-step pipeline

Indexing Adapters Architecture

Factory Pattern for pluggable components (⭐ = Current default)

Indexing Adapters Architecture - Factory Pattern for pluggable components (⭐ = Current default)
🔍

Retrieval

Retrieval Architecture Overview

Supervisor orchestrating three specialized agents

Retrieval Architecture Overview - Supervisor orchestrating three specialized agents

Supervisor Workflow Detailed

Query Split → Orchestrate → Synthesize

Supervisor Workflow Detailed - Query Split → Orchestrate → Synthesize

RAG Agent Workflow

Memory Check → Hybrid Search → Rerank(0.7*dense + 0.3*sparse) → Generate

RAG Agent Workflow - Memory Check → Hybrid Search → Rerank → Generate

Chat Agent Workflow

Conversation memory management + LLM generation

Chat Agent Workflow - Conversation memory management + LLM generation

Integration Agent Workflow

Supervisor Multi-Agent architecture

Integration Agent Workflow - Supervisor Multi-Agent architecture

Shop Multi-Agent Detailed Architecture

Supervisor coordinating three specialized agents

Shop Multi-Agent Detailed Architecture - Supervisor coordinating three specialized agents
🎨

Design Patterns

Design Patterns Overview

8 core design patterns used in the system

Design Patterns Overview - 8 core design patterns used in the system
🔄

Data Flow

Indexing Data Flow

From document upload to vector storage

Indexing Data Flow - From document upload to vector storage

Retrieval Data Flow

From user query to result display (RAG mode)

Retrieval Data Flow - From user query to result display (RAG mode)