Skip to content

bcgov/unity-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

346 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity AI - Platform

AI-powered

  • Reporting system that converts natural language questions into SQL queries with Metabase integration.
  • Application assessment system allowing for autonomous background application review and scoring.

Quick Start

  1. Navigate to applications directory:
cd applications
  1. Configure environment:
cp .env.example .env
# Edit .env with your Azure OpenAI, JWT, and Metabase credentials
  1. Start the application:
docker-compose up --build
  1. Access the application:

Architecture

Single Combined Container: Flask serves both the Angular frontend (static files) and backend API endpoints.

Browser (localhost:80) → Flask (container port 8080)
                          ├── /api/* → Backend API
                          └── /*     → Angular static files

Key Features

  • AI Query Generation: Natural language to SQL conversion using Azure OpenAI
  • Smart Authentication: JWT with hybrid local/production modes (URL tokens for localhost, PostMessage for production)
  • Origin Security: ORIGIN_URL environment variable for iframe origin validation
  • Chat Management: Conversation history and AI-powered SQL explanations
  • Admin Dashboard: Feedback collection and administrative controls
  • Multi-tenant: Configurable database mappings and tenant isolation
  • Vector Search: PostgreSQL with pgvector for intelligent schema embeddings

Project Structure

unity-ai/
├── applications/
│   ├── Unity.AI.Reporting.Backend/    # Flask API + AI SQL generation
│   ├── Unity.AI.Reporting.Frontend/   # Angular chat interface
│   ├── Dockerfile                     # Combined frontend+backend build
│   ├── docker-compose.yml             # Local development setup
│   ├── .env.example                   # Configuration template
│   └── README.md                      # Deployment guide
├── documentation/                      # Project documentation
└── .github/workflows/                 # CI/CD pipelines

Documentation

Tech Stack

  • Frontend: Angular 21, TypeScript 5.9, Vitest 4
  • Backend: Flask 3.1 (Python 3.13), Azure OpenAI, LangChain, pgvector
  • Database: PostgreSQL 17 with pgvector extension
  • Container: Docker (multi-stage build, OpenShift compatible)

License

Licensed under the MIT License. See LICENSE for details.

Contributing

This is a BC Government project. For questions or issues, please contact the development team.

About

Unity AI endpoint used to communicate and produce AI responses

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors