Skip to main content

Ochabot RAG Tools

Project description

OCHABOT GPT OR RAG (RTFM)

OCHABOT Push to Registry

Description

this project used on my profile page: iank.me. Based on mistral AI, OpenAI, Groq, langchain and chroma vector database, I'm still learning, and this is my first project in AI

Platform Support

AI Platform

  • OpenAI
  • MistralAI
  • Groq
  • Deepseek
  • Ollama

Embedding

  • Huggingface
  • Mistral
  • Nvidia

Requirements

Databse

  • Redis (LLM Cache and setup)
  • Postgree (History)
  • ChromaDB (Vector Database)

Storage

  • Minio

How To Run

Running via poetry and activate virtualenvironment

poetry env activate

Run the serve

poetry run http serve

Install Requirement

poetry install

Environment Setup

cp env.example .env

please setup APP_ENVIRONTMENT to local if you setup on development mode

Running

python main.py serve

with docker

docker compose up --build

Migration

Using Alembic

alembic revision -m "Your Table"

run migration

alembic upgrade head

Swagger

http://localhost:8081/docs

Default User

username: admin
password: admin

Socket

url:

localhost:8081/ex/v1/chat/ws/{client_id}

payload:

{
    "chat": "hello",
    "collection": "ocha_v2",
    "llm": "openai", // optional
    "model": "gpt-4o-mini" // optional
}

Structured Diagram

graph TB
    User((External User))
    
    subgraph "Ochabot System"
        subgraph "API Layer"
            FastAPI["API Server<br>(FastAPI)"]
            Router["Router<br>(FastAPI Router)"]
            WebSocket["WebSocket Handler<br>(FastAPI WebSocket)"]
            
            subgraph "API Components"
                ChatHandler["Chat Handler<br>(Python)"]
                UserHandler["User Handler<br>(Python)"]
                IngestHandler["Ingest Handler<br>(Python)"]
                PromptHandler["Prompt Handler<br>(Python)"]
                SetupHandler["Setup Handler<br>(Python)"]
                ClientHandler["Client Handler<br>(Python)"]
                LoginHandler["Login Handler<br>(Python)"]
            end
        end

        subgraph "LLM Services"
            LLMWrapper["LLM Wrapper<br>(Python)"]
            
            subgraph "LLM Providers"
                OpenAI["OpenAI Service<br>(OpenAI API)"]
                Mistral["Mistral Service<br>(Mistral API)"]
                Groq["Groq Service<br>(Groq API)"]
                DeepSeek["DeepSeek Service<br>(DeepSeek API)"]
                Ollama["Ollama Service<br>(Ollama API)"]
            end
        end

        subgraph "Data Storage"
            PostgreSQL[("PostgreSQL<br>(Primary Database)")]
            Redis[("Redis<br>(Cache)")]
            MinIO[("MinIO<br>(Object Storage)")]
            ChromaDB[("ChromaDB<br>(Vector Store)")]
        end

        subgraph "Core Services"
            DatabaseService["Database Service<br>(SQLAlchemy)"]
            VectorService["Vector Store Service<br>(LangChain)"]
            CacheService["Cache Service<br>(Redis Stack)"]
            StorageService["Storage Service<br>(MinIO)"]
        end
    end

    %% Connections
    User -->|"HTTP/WebSocket"| FastAPI
    FastAPI -->|"Routes"| Router
    Router -->|"Handles WebSocket"| WebSocket
    
    %% API Components connections
    Router --> ChatHandler
    Router --> UserHandler
    Router --> IngestHandler
    Router --> PromptHandler
    Router --> SetupHandler
    Router --> ClientHandler
    Router --> LoginHandler

    %% LLM Service connections
    ChatHandler --> LLMWrapper
    LLMWrapper --> OpenAI
    LLMWrapper --> Mistral
    LLMWrapper --> Groq
    LLMWrapper --> DeepSeek
    LLMWrapper --> Ollama

    %% Data Storage connections
    DatabaseService --> PostgreSQL
    CacheService --> Redis
    StorageService --> MinIO
    VectorService --> ChromaDB

    %% Service Usage connections
    ChatHandler --> DatabaseService
    UserHandler --> DatabaseService
    IngestHandler --> DatabaseService
    PromptHandler --> DatabaseService
    SetupHandler --> DatabaseService
    ClientHandler --> DatabaseService
    LoginHandler --> DatabaseService

    ChatHandler --> VectorService
    IngestHandler --> VectorService
    
    ChatHandler --> CacheService
    UserHandler --> CacheService
    
    IngestHandler --> StorageService

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ochabot-0.8.4.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ochabot-0.8.4-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file ochabot-0.8.4.tar.gz.

File metadata

  • Download URL: ochabot-0.8.4.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for ochabot-0.8.4.tar.gz
Algorithm Hash digest
SHA256 3db1ad529431f7fd08d41f2a356b62a9639418c3044006d39f40f4ad083bd202
MD5 915387a54d572fa34143426ea4ec0a4b
BLAKE2b-256 db7e38a7eb76c1547c3ccd5a696e7a184fb3771879bc2197ce5a516355c394c5

See more details on using hashes here.

File details

Details for the file ochabot-0.8.4-py3-none-any.whl.

File metadata

  • Download URL: ochabot-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 48.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/23.6.0

File hashes

Hashes for ochabot-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e72080e97af05f4c552aca95c0af0ee5333eebb3d44190e76df984ba12a27436
MD5 106e794b3d5f6d38cb5b854578550ff7
BLAKE2b-256 5ebc8d0c6ad94ee1ae146f75ad09806dc8e764ea439b5dbfbd67b36a35170c3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page