Skip to content

Repository files navigation

PolyTalk AI Logo

PolyTalk AI

A sleek, highly responsive, multilingual conversational companion.

Node.js Python Groq License


PolyTalk AI is a beautiful, premium, glassmorphic conversational interface supporting English, Tamil (தமிழ்), and Malayalam (മലയാളം) via both text and voice.

It incorporates full-fidelity layout design, responsive sidebars, custom-synthesized notification audio cues, real-time character/word counts, and automatic language detection with localized Speech Synthesis playback.

📋 Table of Contents


✨ Key Features

  • Multilingual Context Generation: Chat in English, Tamil, or Malayalam.
  • Dialect Locking: Sidebar controls to enforce AI to generate responses exclusively in a specific dialect.
  • Regex JSON Parsing: Robust JSON extraction mechanism bypassing typical LLM hallucination issues.
  • Glassmorphic UI: Smooth animations, dynamic gradient backgrounds, and an immersive user experience.
  • Dual Server Implementations: Bootable in Node.js (for high-scale production) or Python/Flask (for local Pythonic development).
  • Voice Synthesis: Reads out messages in the native language automatically via Web Speech API.

🏛 Architecture

PolyTalk uses a robust dual-backend architecture to bridge the gap between lightweight UI development and heavy server orchestration.

For a complete breakdown, please read our Architecture Documentation.


🛠 Tech Stack

Category Technologies
Frontend Vanilla HTML5, CSS3, JavaScript (ES6)
Styling Tailwind CSS via CDN, Lucide Icons
Backend (Prod) Node.js, Express.js, TypeScript, tsx
Backend (Dev) Python 3, Flask, Werkzeug
AI Models llama-3.1-8b-instant via Groq Cloud
Tooling Vite, dotenv, rate-limiter-flexible

📁 Project Structure

polytalk-ai/
├── .github/                   # CI/CD Workflows and Issue Templates
├── docs/                      # Technical Documentation
├── static/                    # Frontend assets
│     ├── css/                 # Glassmorphic stylesheets
│     ├── js/                  # SPA orchestration and voice routing
│     └── favicon.svg          # Vector branding
├── chatbot/                   # Python AI pipeline components
├── templates/                 # Flask HTML routes
├── app.py                     # Local Flask server
├── server.ts                  # Production Node server
├── package.json               # Node dependency manifest
├── requirements.txt           # Python dependency manifest
└── CHANGELOG.md               # Versioning history

🚀 Installation & Setup

Option 1: Node.js (Production Mode)

Ideal for standard deployment.

# 1. Install dependencies
npm install

# 2. Configure environment
cp .env.example .env
# Edit .env and insert your GROQ_API_KEY

# 3. Start server
npm run dev

The server will run on http://localhost:3000

Option 2: Python / Flask (Development Mode)

Ideal for AI testing and scripting.

# 1. Setup virtual environment
python -m venv venv
source venv/bin/activate  # Or .\venv\Scripts\Activate.ps1 on Windows

# 2. Install dependencies
pip install -r requirements.txt

# 3. Configure environment
cp .env.example .env
# Edit .env and insert your GROQ_API_KEY

# 4. Start server
python app.py

The server will run on http://localhost:5000


🛡 Security Features

  • Prompt Injection Defense: Both Node and Python servers run synchronous heuristics to block malicious context alterations.
  • XSS Sanitization: Native HTML encoding parses user output before DOM injection.
  • Rate Limiting: IP-based sliding window ratelimiting restricts /chat to prevent billing exhaustion.
  • Error Obfuscation: Global handlers prevent raw server traces from leaking to the frontend SPA.

🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Please check out our Bug Report Template if you find an issue.

📄 License

This project is open-source and available under the MIT License.

About

A multilingual AI web assistant with dialect-aware conversations and Groq-powered responses.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages