Skip to content
/ oChat Public

ollama powered ChatBot run locally with some features

Notifications You must be signed in to change notification settings

cas1m1r/oChat

Repository files navigation

oChat - Async Persona-Driven Chat Interface

A sleek, modern Flask-based chat UI for AI assistants featuring:

  • Async model replies
  • 🎭 Persona + emotional-state engine
  • 💾 Conversation saving/loading
  • 🗺️ Right-hand minimap of saved chats
  • 🌓 Dark/Light mode toggle
  • 🔄 Retryable error bubbles on failed replies
  • 🧩 Clean template separation (chat.html)

📁 Project Structure

oChat/
│
├── chat_async.py
├── api.py
├── characters.py
│
├── templates/
│   └── chat.html
│
├── saved_conversations.json
└── assistant_personalities/

🚀 Getting Started

1. Install Dependencies

pip install flask
pip install asyncio

2. Run the Server

python chat_async.py

3. Access the UI at:

http://localhost:4000

✨ Features

UI Features

  • dark/light mode
  • Saved conversation snapshots
  • Auto-scroll + typing indicators
  • Retry bubble for failed model responses
  • Right sidebar with clickable conversation history
  • Clean message bubble animation

Backend Features

  • Async model inference routing
  • Persona system with emotional state engine
  • Context summarization
  • Pluggable LLM backends (local or remote)
  • Conversation reconstruction and history management

🎭 Personas

Personas live in:

assistant_personalities/*.json

Each persona includes:

  • core_motives
  • delivery_style
  • signal_strategy
  • audience_affinities

Emotional states live in:

assistant_personalities/emotion_states.json

Select the persona via:

export EMOTIONS=Node

💾 Saving & Loading Conversations

  • Click 💾 Save to snapshot the current chat.
  • Right sidebar shows:
    • name
    • timestamp
    • message count

Stored in:

saved_conversations.json

🔧 Backend Customization

Create custom personalities for your chatbot by creating a new JSON configuration in assistant_personalities


🧪 Error Handling

If the backend times out or fails:

  • A red bubble appears: "Failed to get a reply. Click to retry."
  • Clicking it resends the same message.