Skip to content

Ljove02/UNAI

Repository files navigation

UNAI

Universal Neural AI Assistant

A hobby project exploring intelligent AI model routing and RAG-based query classification.


Overview

UNAI started as a side project driven by curiosity: what if you could automatically choose the right AI model for each question? Instead of manually switching between ChatGPT, DeepSeek, or Gemini, what if the system just knew which one to use?

This project explores that idea. It's a modular chat system that unifies multiple AI models into a single interface, using similarity search and context analysis to route queries to the most appropriate model.

The result is a learning experiment that combines RAG concepts, vector databases, and multi-model orchestration into one practical application.


Vision

The idea is straightforward: what if an AI assistant could know which model to use for each task? A system that combines the reasoning power of DeepSeek, the versatility of GPT, and the capabilities of Gemini into one unified experience.

This project is an exploration of that concept. Instead of manually switching between AI services, users interact with an intelligent router that attempts to automatically select the right tool for the job.

The goal: learn how RAG and vector similarity can improve model selection, and build something useful in the process.


Technologies

Frontend

  • React with TypeScript and JavaScript
  • Next.js for server-side rendering and routing
  • Tailwind CSS for modern, responsive styling

Backend & Data

  • Supabase as vector database and backend
  • Similarity search for intelligent query routing
  • Real-time synchronization for live updates

AI Models

  • OpenAI GPT for general-purpose conversation and reasoning
  • DeepSeek with transparent thinking mode for complex problem-solving
  • Google Gemini for multimodal capabilities

Features

Core Functionality

Feature Description
Multi-Model Integration Seamlessly connects GPT, DeepSeek, and Gemini in one interface
Automatic Model Selection Analyzes queries and routes to the optimal model
Manual Override Gives users control to select specific models when needed
Vector Search Uses similarity search for context-aware routing

User Experience

  • Chat History Management - Never lose a conversation
  • Folder Organization - Structure your chats logically
  • Template System - Create and reuse common prompts
  • Markdown Rendering - Beautiful, formatted responses
  • DeepSeek Thinking Mode - See the reasoning process in real-time

Data Management

  • Persistent Storage - All conversations saved to Supabase
  • Custom Folders - Organize chats your way
  • Reusable Templates - Speed up common workflows
  • Cloud Sync - Access your data from anywhere

Project Structure

UNAI/
├── app/                              # Next.js app router pages
├── components/                       # React components and UI elements
├── lib/                              # Core logic and utilities
│   ├── models/                       # AI model integrations (GPT, DeepSeek, Gemini)
│   ├── router.js                     # Intelligent routing logic
│   └── supabase.js                   # Database configuration
├── supabase_vector_data_for_exp/     # Vector database import data
│   └── documents_rows.csv            # Embeddings for similarity matching
├── public/                           # Static assets
└── styles/                           # Global styles and theme

Current Status

Hobby Project - Active Experimentation

This is a personal side project, built out of curiosity about AI model routing and RAG systems. The core functionality is complete and working.

What works now:

  • All three AI models integrated and functional
  • Automatic model selection using similarity search
  • Manual model override when needed
  • Context tracking with usage visibility
  • Chat interface with history and organization
  • Template system
  • Supabase integration for persistence

What's being explored:

  • Optimizing similarity search and matching algorithms
  • Improving routing accuracy for edge cases
  • Fine-tuning the balance between different models
  • Performance improvements

Goal

Build a functional AI assistant that explores these ideas:

Intelligence - The auto-chooser works. Now the question is: how much better can similarity matching get?

Simplicity - How simple can the interface be while still offering useful functionality?

Control - What's the right balance between automation and manual selection?

Learning - Use this as a playground to understand multi-model orchestration, vector databases, and intelligent routing optimization

Usefulness - Make something that's actually helpful, even as a learning project


Installation

Prerequisites

  • Node.js 18+ installed
  • Supabase account and project
  • API keys for OpenAI, DeepSeek, and Gemini

Quick Start

# Clone the repository
git clone https://github.com/YOUR_USERNAME/UNAI.git
cd UNAI

# Install dependencies
npm install

Configuration

1. Set up Supabase

You'll need your own Supabase project for the vector database:

  1. Create a new project at Supabase
  2. Import the vector data from supabase_vector_data_for_exp/documents_rows.csv into your Supabase database
  3. This CSV contains the embeddings used for similarity matching and model selection

2. Configure Environment Variables

Create a .env.local file in the project root:

# Supabase Configuration (use YOUR project credentials)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

# AI Model API Keys
OPENAI_API_KEY=your_openai_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
GEMINI_API_KEY=your_gemini_api_key

Run Development Server

npm run dev

Open http://localhost:3000 in your browser.

Build for Production

npm run build
npm start

Deployment

UNAI is optimized for deployment on Vercel, the platform built for Next.js applications.

Deploy with Vercel

  1. Push your code to GitHub
  2. Import the repository in Vercel
  3. Add environment variables in Vercel dashboard
  4. Deploy

Every push to your main branch will automatically deploy updates.


Contributing

Contributions are welcome. Whether it's bug fixes, feature additions, or documentation improvements, feel free to open an issue or submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Acknowledgments

Built with modern tools and powered by cutting-edge AI models:


UNAI - One interface. Multiple minds. Optimal answers.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors