Skip to content
/ Lio Public

Streamlined Document Processing & AI-Powered Customer Engagement with Multi-Format File Support and Retrieval-Augmented Chat

Notifications You must be signed in to change notification settings

su-shubham/Lio

Repository files navigation

🚀 Lio

Lio is a comprehensive service designed for efficient document processing and interactive chat capabilities powered by retrieval-augmented generation. Leverage the power of advanced retrieval techniques to integrate document context seamlessly into chat interactions for more precise and context-aware responses.

🔄 Architecture Overview: Built on a robust web-queue-worker pattern where FastAPI handles web requests, Redis manages message queues, and Dramatiq workers process background tasks asynchronously. Powered by Qdrant vector database for efficient document storage and retrieval, leveraging Cohere/OpenAI embeddings, and LangChain for seamless AI interactions and document processing pipeline.

📑 Table of Contents

🎯 Prerequisites

Ensure you have the following installed on your system:

  • 🐍 Python 3.12.x
  • 📦 PDM (Python Dependency Management)
  • 🐳 Docker for running Redis

⚙️ Setup and Installation

📥 Step 1: Install PDM

PDM is used to manage Python dependencies. Run the following command to install PDM if it's not already installed:

pip install pdm

📦 Step 2: Install Project Dependencies

Navigate to your project directory and run:

pdm install

This command will create a virtual environment and install the dependencies listed in pyproject.toml.

🐳 Step 3: Start Redis Using Docker

Run the following commands to start Redis and Qdrant services:

Start Redis:

docker run --name redis_container -p 6379:6379 -d redis:latest

These commands will download the Redis and Qdrant images (if not already available) and start the containers.

🔑 Step 4: Create a .env File

Create a .env file in the root directory to set environment variables:

QDRANT_HOST=localhost
QDRANT_PORT=6333
COHERE_API_KEY=your_cohere_api_key
OPENAI_API_KEY=your_openai_api_key

▶️ Running the Application

🚀 Run the FastAPI Main Application

Use PDM to start the FastAPI server:

pdm run uvicorn app.main:app --host 0.0.0.0 --port 8000

This command runs your FastAPI application, which can be accessed at http://localhost:8000.

👷 Running Background Workers

⚡ Run Dramatiq Workers

Dramatiq is used for background tasks. Start the workers using:

pdm run dramatiq app.workers

This command starts the Dramatiq worker processes for handling background tasks.


📝 End Notes

🔍 Quick Troubleshooting Guide

  • ❌ If PDM install fails:
    pdm install --no-lock
  • 🔄 If Redis container fails:
    docker restart redis_container
  • 💡 Check logs with:
    docker logs redis_container

📷 Screenshots:

alt text

About

Streamlined Document Processing & AI-Powered Customer Engagement with Multi-Format File Support and Retrieval-Augmented Chat

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published