Skip to content

Instantly share code, notes, and snippets.

View KaushikShresth07's full-sized avatar

Kaushik Shresth KaushikShresth07

View GitHub Profile
_BRAIN_SYSTEM_PROMPT = """You are a query classifier for an AI assistant. Your ONLY job is to decide whether a user's message needs LIVE WEB SEARCH or not.
Output EXACTLY one word: either "general" or "realtime".
- general: ONLY questions that are purely from static knowledge, learning data, or conversation. Examples: "Tell me a joke", "What did I ask you before?", "Open YouTube", "Write a poem about cats", "How do I improve my coding?", "What is the capital of France?", casual chit-chat. NO questions about people, current events, or things that could change.
- realtime: ALWAYS use realtime for:
* ANY question about a person (famous or not): "Who is Elon Musk?", "Tell me about [person]", "What is [name] known for?", "Who is that actor?" — the LLM has no real-time data; web search finds current info and may find info on lesser-known people.
* Anything that could have changed: news, weather, stock prices, sports scores, elections, "latest", "current", "today", "recent", "now".
* Factual lookups where r
:root {
--bg: #050510;
--glass-bg: rgba(10, 10, 28, 0.72);
--glass-border: rgba(255, 255, 255, 0.06);
--glass-hover: rgba(255, 255, 255, 0.10);
--accent: #7c6aef;
/* ================================================================
J.A.R.V.I.S Frontend — Main Application Logic
================================================================
ARCHITECTURE OVERVIEW
---------------------
This file powers the entire frontend of the J.A.R.V.I.S AI assistant.
It handles:
1. CHAT MESSAGING — The user types (or speaks) a message, which is
class OrbRenderer {
constructor(container, opts = {}) {
this.container = container;
this.hue = opts.hue ?? 0;
this.hoverIntensity = opts.hoverIntensity ?? 0.2;
this.bgColor = opts.backgroundColor ?? [0.02, 0.02, 0.06];
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#050510">
<title>J.A.R.V.I.S</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
# =============================================================================
# J.A.R.V.I.S — Environment Variables (Full Control)
# =============================================================================
# Copy this file to .env and fill in your values. Never commit .env to git.
# All settings below are optional except GROQ_API_KEY (required for chat).
# =============================================================================
# ==============================
# GROQ API (Required for chat)
"""
CONFIGURATION MODULE
====================
PURPOSE:
Central place for all J.A.R.V.I.S settings: API keys, paths, model names,
and the Jarvis system prompt. Designed for single-user use: each person runs
their own copy of this backend with their own .env and database/ folder.
WHAT THIS FILE DOES:
- Loads environment variables from .env (so API keys stay out of code).
- Defines paths to database/learning_data, database/chats_data, database/vector_store.
# Web framework & server
fastapi>=0.100.0,<1.0
uvicorn[standard]>=0.22.0
# LangChain (LLM orchestration)
langchain>=0.3.0
langchain-groq>=0.2.0
langchain-community>=0.3.0
langchain-core>=0.3.0
langchain-huggingface>=0.1.0
# J.A.R.V.I.S - Just A Rather Very Intelligent System
An intelligent AI assistant built with FastAPI, LangChain, Groq AI, and a modern glass-morphism web UI. JARVIS provides three chat modes (Jarvis, General, Realtime), streaming responses, text-to-speech, voice input, and learns from your personal data files. Everything runs on one server with one command.
**Quick start:** `pip install -r requirements.txt` → create `.env` with `GROQ_API_KEY` → `python run.py` → open http://localhost:8000
---
## Table of Contents
# J.A.R.V.I.S - Just A Rather Very Intelligent System
An intelligent AI assistant built with FastAPI, LangChain, Groq AI, and a modern glass-morphism web UI. JARVIS provides two chat modes (General and Realtime with web search), streaming responses, text-to-speech, voice input, and learns from your personal data files. Everything runs on one server with one command.
---
## Table of Contents
- [Quick Start](#quick-start)
- [Features](#features)