Webv1.0.0

Emly Prediction Agentcode

Open-source no-code AutoML platform for predictive analytics built with FastAPI, React, and scikit-learn. Upload data, train regression/classification/clustering models manually or with LLM-powered AutoML wizard, prepare data with AI copilot, build interactive dashboards, connect to SQL databases, and deploy predictions-all without writing code

Maintainer

umars
umarsverifiedMaintainer

Open-source developer contributing to regional tech capacity in Jammu & Kashmir.

Starsstar0
StatusVerified

Review Status

CI QUALITY✓ PASS
DOCS AUDIT✓ PASS
LICENSEMIT
SECURITY✓ SECURE

Technologies

menu_bookREADME.md

Emly Prediction Agent

An AI-powered predictive analytics platform for non-technical users. Upload data, train machine learning models, and make predictions — all through a simple web interface.

Features

  • Data Upload — CSV, Excel, JSON, ZIP files with chunked upload and resume
  • Data Connectors — Import from PostgreSQL, MySQL, SQLite, MSSQL, Oracle, SFTP
  • Data Preparation — Interactive table editor with 40+ operations and AI copilot
  • Machine Learning — 16 algorithms for regression, classification, and clustering
  • AutoML — AI-powered model selection using natural language descriptions
  • Dashboards — Build interactive charts and visualizations
  • Model Testing — Batch predictions, one-by-one testing, and manual form input

Quick Start (3 Steps)

Prerequisites

  • Python 3.10
  • Node.js 18+
  • PostgreSQL 14+ with pgvector extension

Step 1: Set Up PostgreSQL

Linux (Ubuntu/Debian)
# Install PostgreSQL and pgvector
sudo apt install postgresql postgresql-15-pgvector

# Start PostgreSQL
sudo systemctl start postgresql

# Create database
sudo -u postgres psql -c "CREATE USER vectoruser WITH PASSWORD 'vectorpass';"
sudo -u postgres psql -c "CREATE DATABASE vectordb OWNER vectoruser;"
sudo -u postgres psql -d vectordb -c "CREATE EXTENSION IF NOT EXISTS vector;"
macOS
# Install PostgreSQL (using Homebrew)
brew install postgresql@16
brew install pgvector

# Start PostgreSQL
brew services start postgresql@16

# Create database
psql postgres -c "CREATE USER vectoruser WITH PASSWORD 'vectorpass';"
psql postgres -c "CREATE DATABASE vectordb OWNER vectoruser;"
psql -d vectordb -c "CREATE EXTENSION IF NOT EXISTS vector;"
Windows
  1. Download and install PostgreSQL 16 from the EDB installer. During installation:

    • Set the password for the postgres superuser (remember this password).
    • Keep the default port 5432.
  2. Install the pgvector extension:

    • Open SQL Shell (psql) from the Start Menu (or use psql from a terminal).
    • Connect to your database and run:
      CREATE EXTENSION IF NOT EXISTS vector;
      
    • Alternatively, download the pgvector Windows binaries and copy into your PostgreSQL installation.
  3. Create the database and user:

    CREATE USER vectoruser WITH PASSWORD 'vectorpass';
    CREATE DATABASE vectordb OWNER vectoruser;
    \c vectordb
    CREATE EXTENSION IF NOT EXISTS vector;
    
Docker (all platforms)
docker run -d --name emly-postgres \
  -e POSTGRES_USER=vectoruser \
  -e POSTGRES_PASSWORD=vectorpass \
  -e POSTGRES_DB=vectordb \
  -p 5432:5432 \
  pgvector/pgvector:pg16

# Enable pgvector extension
docker exec -it emly-postgres psql -U vectoruser -d vectordb \
  -c "CREATE EXTENSION IF NOT EXISTS vector;"

Step 2: Configure Environment

Clone the repository, then copy .env.sample to .env and edit the .env file:

git clone https://github.com/emly/emly-prediction-agent.git
cd emly-prediction-agent
cp .env.sample .env

On Windows (PowerShell):

git clone https://github.com/emly/emly-prediction-agent.git
cd emly-prediction-agent
copy .env.sample .env

Edit .env with your settings:

# Database (required)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=vectordb
POSTGRES_USER=vectoruser
POSTGRES_PASSWORD=vectorpass

# LLM (required for AI features: AutoML, Copilot)
EMLY_SOURCE=openai
EMLY_MODEL=gpt-4.1-mini
EMLY_KEY=sk-your-openai-api-key-here

# Optional: Custom LLM Base URL
# When LLM_URL is provided, the application connects to that URL using the
# OpenAI-compatible API format (works with LiteLLM, Ollama, vLLM, LocalAI, etc.).
# In this mode, EMLY_KEY and EMLY_MODEL must be valid for the target endpoint:
#   - EMLY_KEY = API key required by that endpoint (use "not-needed" if none required)
#   - EMLY_MODEL = model name served by that endpoint
# Example for Ollama running locally:
#   LLM_URL=http://localhost:11434/v1
#   EMLY_MODEL=llama3
#   EMLY_KEY=not-needed
# Example for LiteLLM proxy:
#   LLM_URL=http://your-litellm-server:4000
#   EMLY_MODEL=gpt-4o
#   EMLY_KEY=sk-your-litellm-key
LLM_URL=

# Embeddings (optional, for document vectorization)
EMBEDDING_SOURCE=huggingface
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2

Step 3: Install and Run

Linux / macOS
# Create Python virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

# Build the frontend (one-time)
cd frontend && npm ci && npm run build && cd ..

# Start the application
python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --env-file .env
Windows (PowerShell)
# Create Python virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# Install Python dependencies
pip install -r requirements.txt

# Build the frontend (one-time)
cd frontend; npm ci; npm run build; cd ..

# Start the application
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --env-file .env

Note: If you get a PowerShell execution policy error when activating the virtual environment, run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Windows (CMD)
:: Create Python virtual environment
python -m venv .venv
.\.venv\Scripts\activate.bat

:: Install Python dependencies
pip install -r requirements.txt

:: Build the frontend (one-time)
cd frontend && npm ci && npm run build && cd ..

:: Start the application
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --env-file .env

Open your browser: http://localhost:8000

That's it. The frontend is served automatically by FastAPI — no separate dev server needed.

Docker Deployment

# Build image
docker build -t emly-prediction-agent .

# Run container
docker run -d --name emly-app \
  -p 8080:8080 \
  -e DB_HOST=host.docker.internal \
  -e DB_PORT=5432 \
  -e DB_NAME=vectordb \
  -e POSTGRES_USER=vectoruser \
  -e POSTGRES_PASSWORD=vectorpass \
  -e EMLY_SOURCE=openai \
  -e EMLY_MODEL=gpt-4.1-mini \
  -e EMLY_KEY=sk-your-key-here \
  -e LLM_URL=http://your-llm-endpoint/v1 \
  emly-prediction-agent

Access at http://localhost:8080

Usage Guide

For detailed instructions on uploading data, training models, building dashboards, and more, see:

USER_GUIDE.md

Tech Stack

LayerTechnology
BackendFastAPI, Peewee ORM, scikit-learn, mljar-supervised, LangChain
FrontendReact 18, Vite, Tailwind CSS, Radix UI, Recharts
DatabasePostgreSQL with pgvector extension
LLMOpenAI, Anthropic, Google Gemini, Ollama, LiteLLM, vLLM, LocalAI (any OpenAI-compatible endpoint)

Project Structure

predictive-agent/
├── app/
│   ├── main.py              # FastAPI entry point
│   ├── config.py             # Environment configuration
│   ├── routes/api.py         # REST API endpoints
│   ├── services/             # Business logic
│   │   ├── prediction_service.py   # ML training, inference, data prep
│   │   ├── automl_service.py       # AutoML with mljar
│   │   ├── llm_service.py          # LLM integration
│   │   └── vectorization.py        # Document vectorization
│   ├── connectors/           # Data source connectors
│   ├── models/               # Database models
│   └── migrations/           # Schema migrations
├── frontend/
│   └── src/
│       ├── App.jsx           # Main application
│       └── components/       # UI components
├── data/
│   ├── prediction/           # Uploaded datasets and trained models
│   └── automl/               # AutoML training results
├── .env                      # Environment configuration
├── requirements.txt          # Python dependencies
└── Dockerfile                # Container build

API Reference

All endpoints are prefixed with /emly/api/prediction.

CategoryMethodEndpointDescription
DatasetsGET/datasetsList all datasets
DatasetsPOST/upload/initInitialize chunked upload
DatasetsPOST/upload/chunk/{id}Upload file chunk
DatasetsPOST/upload/complete/{id}Finalize upload
ModelsGET/modelsList trained models
ModelsGET/algorithmsList available algorithms
ModelsPOST/train/startStart model training
ModelsGET/train/status/{job_id}Check training progress
ModelsGET/models/{id}/reportGet model diagnostics
InferencePOST/inferRun predictions
AutoMLPOST/automl/detect-problemDetect problem type
AutoMLPOST/automl/startStart AutoML training
DashboardsGET/dashboardsList dashboards
DashboardsPOST/dashboardsCreate dashboard
ConnectorsGET/connectorsList connectors
ConnectorsPOST/connectors/sqlCreate SQL connector
HealthGET/healthSystem health metrics

Troubleshooting

ProblemSolution
Database connection failedCheck PostgreSQL is running and credentials in .env are correct
Module not foundActivate virtual environment: source .venv/bin/activate (Linux/macOS) or .venv\Scripts\Activate.ps1 (Windows)
Port in useChange APP_PORT in .env or stop other process
pgvector errorRun CREATE EXTENSION IF NOT EXISTS vector; in your database
Frontend not loadingRun cd frontend && npm run build
AI features not workingSet valid EMLY_KEY in .env
LLM_URL not connectingEnsure EMLY_KEY and EMLY_MODEL are valid for the endpoint at LLM_URL. For local endpoints (Ollama, vLLM) set EMLY_KEY=not-needed
Windows: python3 not recognizedUse python instead of python3 on Windows
Windows: PowerShell script execution errorRun Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Windows: pgvector extension installSee pgvector Windows build instructions or use Docker

Refer USER_GUIDE FOR MORE DETAILS

02 — Explore

Suggested Projects

DIRECTORY INDEX arrow_forward
Webstar 0

VisionCue — Real-Time Non-Verbal Behaviour Analytics

Browser-based computer vision system for real-time non-verbal behaviour, attention, gesture and video-quality analysis using MediaPipe and React.

MU
musaib-nazir
View arrow_forward
Webstar 0

Emly AI Assistant

Open-source multi-bot AI chatbot platform built with FastAPI, LangGraph, and Qdrant. Features RAG (Retrieval-Augmented Generation) with document ingestion, intent-routed conversation agents, admin console, embeddable chat widget, OIDC auth, and multi-channel support for Slack, Microsoft Teams, Telegram, WhatsApp, Google Chat etc.