Skip to content

isaacaisha/siisi

Repository files navigation


·SìįSí·AI - Intelligent Conversational Platform

License: MIT Python Version Django Version Framework

·SìįSí·AI is a sophisticated, real-time conversational AI application built with Django and powered by Google's Gemini family of models. It provides a seamless, multimodal experience, allowing users to interact with an intelligent agent through text, voice, webcam, screen sharing, and generative imagery and video.

Platform Demo


✨ Core Features

The application is split into a robust user management system and a powerful, real-time AI interaction suite.

👤 User & Authentication System (users app)

  • Secure User Registration: New users can create an account with a name, email, and password.
  • Two-Factor Authentication (2FA):
    • Robust login flow using django-two-factor-auth.
    • Users can enable Time-based One-Time Password (TOTP) 2FA from their profile for enhanced security.
  • Profile Management: A dedicated profile page to manage 2FA settings.
  • Standard Authentication Views:
    • Custom-styled Login, Logout, and Registration pages.
    • Full password reset functionality via email.

💬 Conversational AI System (siisi_app)

  • Real-time Multimodal Chat:
    • Text Input: Classic text-based chat interface.
    • Voice Conversation: Talk directly to the AI and receive spoken responses in real-time.
    • Webcam Vision: Enable your webcam to let the AI "see" and comment on your surroundings.
    • Screen Sharing: Share your screen to get help with code, documents, or applications.
  • Persistent Chat History:
    • All conversations are saved and linked to the user's account.
    • Users can switch between past chat sessions.

🎨 AI Image Generation & Management

A complete, end-to-end feature set for creating and managing AI-generated images.

  • Text-to-Image Generation Page: An intuitive interface for users to enter a text prompt and specify the number of images to create.
  • Dedicated Image Gallery: A beautifully rendered gallery for users to browse all their creations.
    • Search Functionality: Instantly filter images by searching for keywords in the original prompts.
    • Pagination: The gallery is paginated to ensure fast loading times, even with hundreds of images.
  • Detailed Image View: Click on any image to navigate to a dedicated detail page showing a larger view and metadata.
  • Full Image Management:
    • Download: Easily download the full-resolution generated image.
    • Deletion: Securely delete images from the gallery and the server.
  • Admin Oversight: Superusers have a complete view of all images generated across the platform, with full management rights.

🎬 AI Video Generation & Management

(NEW!) A full suite of features for generating and managing AI videos.

  • Text-to-Video Generation Page: A dedicated interface for users to enter a prompt and initiate a video generation task.
  • Asynchronous Task Handling: Video generation is a long-running process. The system handles this asynchronously, allowing users to track the progress of their video without waiting on the page.
  • Video Gallery: Browse all generated videos with previews and status indicators.
  • Detailed Video View: A dedicated page to view the final rendered video, along with its generation status and metadata.
  • Full Video Management:
    • Download: Download the final MP4 video file.
    • Deletion: Securely delete videos and their associated files.

🤖 RESTful API Endpoints

The application exposes a well-documented browsable API for programmatic access.

  • Authentication Endpoints (/api/auth/):
    • register/, login/, logout/, profile/
  • Chat Endpoints (/api/chat/):
    • GET /api/chat/sessions/: List all of the authenticated user's chat sessions.
    • GET /api/chat/sessions/{id}/: Retrieve details and messages of a specific chat session.
    • POST /api/chat/ai/: The main endpoint for sending a text message to the AI and receiving a response.
  • Image Generation Endpoints (/api/images/):
    • POST /api/images/: Generate new images from a text prompt.
    • GET /api/images/: List all images created by the authenticated user.
    • GET /api/images/{id}/: Retrieve details for a specific image.
    • DELETE /api/images/{id}/: Delete a specific image.
  • Video Generation Endpoints (/api/videos/):
    • POST /api/videos/: Initiate a new video generation task from a text prompt.
    • GET /api/videos/: List all videos created by the authenticated user.
    • GET /api/videos/{id}/: Retrieve details and status for a specific video generation task.
    • GET /api/videos/{id}/check-status/: A dedicated endpoint to poll for the status of a video generation task.
    • DELETE /api/videos/{id}/: Delete a specific video.

🖼️ Screenshots

(Suggestion: Create a docs/ folder in your project root and add screenshots to showcase your application's features.)

Image Generation Page Image Gallery Video Generation Page
Image Generation Image Gallery Video Generation

🛠️ Tech Stack

  • Backend: Django, Django REST Framework
  • Real-time Communication: WebSockets (via websockets library)
  • AI Models: Google Gemini (for chat), Google Imagen (for images), Google Veo (for video)
  • Database: PostgreSQL with pgvector for similarity search.
  • Authentication: django-two-factor-auth
  • Local Environment: python-dotenv

🚀 Getting Started

Follow these instructions to set up and run the project locally for development and testing.

1. Prerequisites

  • Python 3.10+
  • PostgreSQL
  • A virtual environment tool (venv is recommended)
  • Google Gemini API Key

2. Local Setup Instructions

a. Clone the Repository

git clone https://github.com/isaacaisha/siisi.git
cd siisi

b. Create and Activate Virtual Environment

python3 -m venv venv
source venv/bin/activate

c. Install Dependencies

pip install -r requirements.txt

d. Configure Environment Variables

Create a .env file in the project root directory. This file will hold your secret keys and database connection string.

# .env
# ---------------------------------------------------
# Make sure to replace placeholders with your actual credentials

# Database configuration
DATABASE_URL=postgresql://postgres:YourPostgresPassword@localhost:5432/siisi_db

# Google Gemini API Key
GEMINI_API_KEY=your_gemini_api_key_here

# Django Secret Key (generate a new one for your project)
SECRET_KEY='your-strong-django-secret-key'

# Set DEBUG=True for local development
DEBUG=True

# WebSocket URL for local development
WEBSOCKET_BASE_URL=ws://localhost:8764
# ---------------------------------------------------

Note: Ensure your PostgreSQL server is running and you have created the siisi_db database.

e. Set up the Database

Run the Django migrations to create the necessary database tables.

python manage.py migrate```

**f. Create a Superuser**

This allows you to access the Django admin panel.
```bash
python manage.py createsuperuser

3. Running the Development Servers

To run the full application locally, you need to start two separate servers in two separate terminals.

Terminal 1: Start the Django Web Server This server handles all standard HTTP requests, user authentication, and serves the main chat.

source venv/bin/activate
python manage.py runserver

Your web application will be available at http://127.0.0.1:8000.

Terminal 2: Start the Live Chat (WebSocket) Server This dedicated server handles the real-time audio, video, and screen-sharing data streams.

source venv/bin/activate
python manage.py run_live_server

This server will be listening on ws://127.0.0.1:8764. The frontend automatically knows how to connect to it.

🎉 You're all set! Open your browser to http://127.0.0.1:8000, register an account, and start chatting with ·SìįSí·AI.

🐳 Docker Deployment (Production)

For production, the application is containerized using Docker and managed with Docker Compose.

1. Build the Docker Images

docker-compose -f docker-compose.prod.yml build

2. Run the Services This will start the Gunicorn web server, the live chat server, and the PostgreSQL database in detached mode.

docker-compose -f docker-compose.prod.yml up -d

3. Stop the Services To stop all running containers:

docker-compose -f docker-compose.prod.yml down

📜 API Endpoint Details

The following provides more detail on the primary API endpoints.

POST /api/chat/ai/

  • Description: Sends a message to the chat AI. Requires authentication.
  • Request Body:
    // To continue an existing chat
    {
      "session_id": "a-uuid-for-the-session",
      "user_message": "Hello, can you help me with Python?"
    }

POST /api/images/

  • Description: Generates one or more images from a text prompt. Requires authentication.
  • Request Body:
    {
      "prompt": "A cyberpunk cityscape at night, neon lights reflecting on wet streets, high detail",
      "number_of_images": 2
    }

POST /api/videos/

  • Description: Initiates an asynchronous video generation task. Requires authentication.
  • Request Body:
    {
      "prompt": "A majestic lion walking on a beach at sunset, cinematic"
    }
  • Success Response (202 Accepted): The API immediately returns a response with the task details, including a check_status_url to poll for progress.
    {
        "id": "e2f0a1b2-c3d4-e5f6-a7b8-c9d0e1f2a3b4",
        "prompt": "A majestic lion walking on a beach at sunset, cinematic",
        "status": "PENDING",
        "created_at": "2025-09-09T12:00:00.000000Z",
        "video_url": null,
        "check_status_url": "/api/videos/e2f0a1b2-c3d4-e5f6-a7b8-c9d0e1f2a3b4/check-status/"
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors