Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 2.06 KB

overview.md

File metadata and controls

53 lines (39 loc) · 2.06 KB

Architecture Overview

ask.UOS uses a multi-layered architecture with modular components, asynchronous processing, and multiple storage layers.

High-Level Architecture

graph TB
    User[User] --> Frontend[Streamlit Frontend]
    Frontend --> API[FastAPI Backend]
    API --> AI[AI Agent]
    API --> Cache[Redis Cache]
    AI --> Tools[Tools Layer]
    Tools --> WebSearch[Web Search]
    Tools --> DocRetrieval[Document Retrieval]
    Tools --> MCP[MCP Subagents]
    DocRetrieval --> VectorDB[Vector Database]
    MCP --> External[External MCP Servers]
    WebSearch --> Crawler[crawl4ai]
    WebSearch --> SQLite[SQLite]
    API --> Logs[Logging System]
Loading

The Streamlit frontend never talks to the AI agent directly — every request goes through the FastAPI backend's /v1/chat/completions streaming endpoint (which therefore OpenAI Compatible). The AI Agent box is the LangGraph engine; the Vector Database box is RAGFlow/Infinity (current) or Milvus (also supported).

System Layers

  • Presentation: Streamlit web application (thin HTTP client)
  • Application: FastAPI backend — business logic and orchestration
  • AI Agent: LangGraph decision engine, including MCP subagent dispatch
  • Data: Redis, RAGFlow/Infinity (current) or Milvus (also supported), SQLite
  • Infrastructure: Docker Compose

Service Architecture

  • app_streamlit / app_worker: Streamlit UI and FastAPI backend as separate services in production (docs/docker-compose.prod.example.yml), the latter run with multiple replicas behind a caddy reverse proxy; the dev docker-compose.yml still runs both in one app container
  • redis: Caching and sessions
  • crawl4ai: Web scraping service
  • RAGFlow/Infinity (or Milvus, if configured): run separately, not part of this app's compose file
  • MCP servers: per-university, externally hosted integrations declared in backend_config.yaml

Data Flow

  • Session data: Redis
  • Vector/document data: RAGFlow/Infinity or Milvus
  • Cache data: Redis
  • Logs: Structured JSON, per-replica files + stdout

Next: Software Architecture →