MJ AI is a state-of-the-art autonomous research agent and intelligence platform. It fuses high-speed cloud inference with a local PyTorch consensus stack, dynamic vector memory recall, and real-time scrapers to deliver deep factual synthesis.
The user experience features a premium glassmorphic interface inspired by campaign-oriented metrics dashboard layouts, operating in a highly-readable Light Theme.
MJ AI operates on a multi-tier hybrid intelligence design:
┌────────────────────────────────────────┐
│ React Frontend (Vite) │
└───────────────────┬────────────────────┘
│ (REST APIs)
┌───────────────────▼────────────────────┐
│ FastAPI Server │
└───────────────────┬────────────────────┘
│
┌───────────────────────┼───────────────────────┐
│ │ │
┌────────▼────────┐ ┌────────▼────────┐ ┌────────▼────────┐
│ Groq Engine │ │ Memory Vector │ │ Local Ensemble │
│ (Llama 3.3 70B)│ │ (JSON / Mongo) │ │ (DistilBERT/MLP)│
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Orchestration & Reasoning (Cloud): Executes agent loops, multi-agent debates, and final responses exclusively via Groq (
llama-3.3-70b-versatile/llama3-8b-8192) for ultra-low latency. - Context Memory (RAG): A vector-like semantic memory space powered by a local JSON fallback (
memory.json) or MongoDB. - Local Consensus Engine (Edge): DistilBERT embeddings connected to a parallel PyTorch Multi-Layer Perceptron (MLP) and Scikit-Learn Random Forest Classifier to compute consensus confidence values on local memories.
MJ_AI/
├── backend/ # Core Service Layer & Neural Engines
│ ├── models/ # Serialized neural weights (model.pth)
│ ├── server.py # FastAPI REST Server
│ ├── main.py # Autonomous reasoning agent loop
│ ├── memory.py # Dual-mode local JSON / MongoDB driver
│ ├── learning.py # DistilBERT & MLP training script
│ ├── train_mcq.py # MCQ dataset pipeline & classifier trainer
│ └── *.py # Mathematical engines & scrapers
│
├── frontend/ # Interactive SPA Client
│ ├── src/
│ │ ├── App.jsx # App layout & Framer Motion transitions
│ │ └── index.css # Glassmorphic light theme design system
│ ├── vite.config.js # Build configuration & proxy tables
│ └── index.html # Entry layout template
│
├── .env # API Credentials (ignored)
├── .gitignore # System and Cache Exclusions
└── requirements.txt # Python Package Manifest
- Frontend SPA: React (v18), Vite, Framer Motion (micro-interactions), Chart.js (analytics rendering), marked (markdown cells).
- AI & Classifiers: Groq API, PyTorch (Deep Neural Head), Transformers (DistilBERT tokenizers), Scikit-Learn (Random Forest & K-Means clustering).
- Research Stack: BeautifulSoup4, DuckDuckGo Scraper, SymPy Algebraic Core.
Configure a .env file at the root of the workspace directory:
GROQ_API_KEY=gsk_your_api_key_here
OPENROUTER_API_KEY=sk-or-v1-your_api_key_hereSet up your Python virtual environment (Python 3.10+ recommended) and run:
# Install required libraries
pip install -r requirements.txt
# Launch FastAPI web engine
python backend/server.pyThe API server will spin up on http://127.0.0.1:8086.
In a separate terminal shell, navigate to the frontend/ directory:
# Install node packages
npm install
# Run hot-reloading development server
npm run devThe client dashboard will be served at http://localhost:3000.
To populate your local memory with the custom Aptitude, Quantitative, and Reasoning MCQ datasets and retrain the edge classifiers:
python backend/train_mcq.py- Glassmorphic Layout: Uses translucent backdrops (
backdrop-filter) with fine border separators to isolate workspace elements. - Campaign-Style Metrics: Displays vector memory capacity, persistence, and classification health using card deck styles inspired by crowdfunding platforms.
- Framer Motion Transitions: Smooth entry animations on card grids, tab switches, and chat bubbles.
- Micro-Animations: Uses dynamic scale adjustments on clicks and CSS pulse elements on active status gauges.
- The Story: A user asks, "Who is the current CEO of Microsoft and what is their background?"
- Under the Hood:
- The agent parses the query and realizes it needs real-time internet data.
- It generates a
[SEARCH: current CEO of Microsoft]command. The web scraper searches DuckDuckGo and fetches search snippet objects. - The agent reads the search results, generates a secondary
[FETCH: URL]command to scrape the official biography page, extracting clean text. - The Groq reasoning core synthesizes the scraped text and returns a clean, detailed biography.
- The Story: During a session, the user asks to summarize a complex topic: "Summarize the core arguments of the security audit."
- Under the Hood:
- The agent compiles a summary block wrapped in programmatic tags:
[MEM_SUMMARY: ...]. - The system detects the summary payload and outputs a confirmation prompt: "Do you want me to save this in memory for future reference? (Yes/No)"
- If the user clicks Confirm, a confetti wave triggers, and the summary is parsed and stored inside
memory.jsonas averified-persistentrecord, becoming part of the agent's long-term retrieval context.
- The agent compiles a summary block wrapped in programmatic tags:
- The Story: Aptitude questions from local JSON files are imported into the system.
- Under the Hood:
- The dataset pipeline loads files from
backend/mcq_dataand stores them in the local memory layer. - The system triggers the local training loop: it computes DistilBERT embeddings for all inputs, clusters them using K-Means, and fits a PyTorch MLP neural network along with a Scikit-Learn Random Forest.
- The next time the user asks a math/logic question that matches the semantic space of the dataset, the local PyTorch + Random Forest heads achieve a consensus score and serve the cached answer in less than 20ms, bypassing cloud inference.
- The dataset pipeline loads files from
- The Story: The user clicks Run RedSage Scan to review the active project codebase.
- Under the Hood:
- The request routes to the
RedSageAgentinside the backend. - The agent scans the filesystem configurations, dependencies, and code patterns for security concerns (e.g. CWE-94, CWE-502).
- It compiles a detailed markdown report, saves it in the
frontendfolder, and returns a direct link for the user to view the audit findings in a new browser tab.
- The request routes to the