π Live Demo β’ π Documentation β’ β‘ API Docs β’ π₯ Demo Video
π A production-inspired AI extraction platform that transforms noisy customer support tickets into schema-compliant JSON using LLMs, strict Pydantic validation, and an intelligent Model-Driven Repair Loop.
β Built for OneInbox AI Engineer Internship Hackathon 2026
β‘ Production-Inspired Architecture
π§ Zero Regex Repair Strategy
- β Production-ready deployment
- π€ AI-Powered Structured Extraction
- π Model-Driven Repair Loop
- π Strict Pydantic Schema Validation
- π‘οΈ PII Redaction
- π¦ Batch Extraction
- π Analytics Dashboard
- π Extraction History
- β€οΈ Health Monitoring
- π Render + Vercel Deployment
- ποΈ Supabase Database
- β‘ Featherless AI + Google Gemma 4 31B
Extract structured, schema-valid JSON from messy customer support tickets using LLMs with a Model-Driven Repair Loop.
Built for the OneInbox AI Engineer Internship Hackathon 2026
| Feature | Status |
|---|---|
| AI Extraction | β |
| Model-Driven Repair Loop | β |
| Strict Schema Validation | β |
| Batch Extraction | β |
| Analytics Dashboard | β |
| Health Monitoring | β |
| Version Endpoint | β |
| Structured Logging | β |
| Docker Deployment | β |
| CI/CD Ready | β |
| Request Correlation IDs | β |
| API Documentation | β |
- Overview
- Features
- Architecture
- Workflow
- Tech Stack
- Project Structure
- Quick Start
- API Reference
- Testing
- Deployment
- Performance
- Known Limitations
- Roadmap
- Contributing
- License
ExtractIQ Engine is a production-inspired AI extraction system that transforms noisy customer support tickets into clean, structured JSON.
Instead of relying on fragile regex patterns, it uses LLMs, strict Pydantic validation, and a Model-Driven Repair Loop to guarantee highly reliable outputs.
Traditional information extraction systems rely on fragile regular expressions or unconstrained LLM outputs, making them unreliable when processing noisy customer support conversations.
ExtractIQ Engine addresses this challenge through an AI-first extraction pipeline powered by strict schema validation and a Model-Driven Repair Loop. Instead of silently accepting invalid outputs or masking failures with handcrafted regex rules, validation errors are fed back into the LLM, enabling targeted self-correction until a schema-compliant response is produced or the retry limit is reached.
The result is a production-inspired extraction workflow that prioritizes structural integrity, transparency, and maintainability.
Customer support tickets are messy β missing punctuation, broken sentences, mixed languages, typing mistakes, missing fields, and unstructured conversations. Traditional regex-based extraction breaks easily, and even modern LLMs frequently produce invalid JSON or violate predefined schemas.
ExtractIQ Engine introduces a Model-Driven Repair Loop:
- Extract β LLM extracts structured data from ticket
- Validate β Pydantic enforces strict schema compliance
- Detect β Validation errors are captured with exact field details
- Repair β Errors are fed back to the LLM for targeted correction
- Repeat β Loop continues until valid or retry limit reached
Extracts structured information from noisy customer support tickets using state-of-the-art LLMs (Featherless AI, Groq).
Every response must satisfy nested Pydantic models with enum enforcement, type checking, and required field validation.
Automatically repairs invalid outputs by feeding validation errors back to the LLM. No regex fallbacks, no force-fitting.
Emails, phone numbers, and zip codes are automatically redacted before any data reaches third-party LLM providers.
Real-time Streamlit dashboard showing success rates, repair rates, latency, category distribution, and historical trends.
Upload and process multiple tickets simultaneously with individual error handling.
Complete history of all extractions with pagination, search, and detailed repair attempt logging.
Comprehensive health endpoint with per-dependency status checks (API, database, LLM provider, disk).
Live extraction statistics including success rates, average processing time, retry distribution, and failure breakdown.
- Request IDs with end-to-end correlation
- Structured JSON logging
- Version endpoint
- Error tracking with correlation IDs
- Global exception handlers
- CORS configuration
Validation errors generated by Pydantic are automatically used to guide the LLM toward producing corrected, schema-compliant responses.
Instead of handcrafted parsing rules, the engine leverages modern LLMs for intelligent structured extraction.
Sensitive information is redacted before being transmitted to external AI providers.
Every request is tracked using structured logging, Request IDs, Correlation IDs, metrics, and health endpoints.
The architecture follows a modular layered design that separates preprocessing, extraction, validation, persistence, and analytics into independent components.
This improves maintainability, simplifies debugging, and allows future scalability without changing the core extraction pipeline.
The system follows a modular pipeline architecture:
βββββββββββββββ
β Raw Ticket β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Preprocess β β PII redaction, normalization, language detection
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β LLM Extract β β instructor + Groq/Featherless
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ ββββββββββββββββ
β Validate βββββββ Repair Loop β β Feed errors back to LLM
ββββββββ¬βββββββ ββββββββββββββββ
β
βΌ
βββββββββββββββ
β Validated β β Schema-compliant JSON
β JSON β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Database β β SQLite (SQLAlchemy)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Analytics β β Streamlit / React Dashboard
βββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Server β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββββ β
β β Routes βββ Service βββ Extraction Engine β β
β ββββββββββββ ββββββββββββ ββββββββββββββββββββββ β
β β β β
β βΌ βΌ β
β ββββββββββββ ββββββββββββββββββββββ β
β β Database β β LLM Provider β β
β β (DB) β β (Groq/Featherless) β β
β ββββββββββββ ββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
User Uploads Ticket
β
βΌ
Text Cleaning & PII Redaction
β
βΌ
LLM Extraction (instructor + Groq/Featherless)
β
βΌ
JSON Validation (Pydantic TicketExtraction)
β
βββ Valid βββ Database Storage βββ Response
β
βββ Invalid βββ Repair Loop
β
βββ (β€3 attempts) Re-prompt with errors
β
βββ Max retries exceeded β Return failure
-
Ticket Ingestion
-
Text Cleaning
-
PII Redaction
-
LLM Extraction
-
Schema Validation
-
Intelligent Repair Loop
-
Database Storage
-
Analytics Generation
-
API Response
| Technology | Purpose |
|---|---|
| FastAPI | REST API framework |
| Python 3.12 | Runtime |
| Pydantic v2 | Schema validation & settings |
| SQLAlchemy 2.0 | ORM |
| SQLite | Database |
| instructor | Structured LLM output |
| Uvicorn | ASGI server |
| Technology | Purpose |
|---|---|
| Featherless AI | Primary LLM provider (default: google/gemma-4-31B-it) |
| Groq | Optional alternate provider (llama-3.3-70b-versatile) |
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| Vite | Build tool |
| TailwindCSS | Styling |
| Recharts | Charts |
| Framer Motion | Animations |
| TypeScript | Type safety |
| Technology | Purpose |
|---|---|
| Streamlit | Analytics dashboard |
| Plotly | Interactive charts |
| Pandas | Data processing |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| GitHub Actions | CI/CD |
| pytest | Testing |
| Black | Code formatting |
| isort | Import sorting |
| Flake8 | Linting |
| mypy | Type checking |
| pre-commit | Git hooks |
- Modular Architecture
- AI-First Engineering
- Production-Inspired Design
- Strict Validation
- Privacy by Default
- Scalable Components
- Observable APIs
ExtractIQ-Engine/
β
βββ backend/
β βββ app/
β β βββ api/ # API routes, models, middleware, error models
β β β βββ routes.py # FastAPI route handlers
β β β βββ models.py # Request/response Pydantic models
β β β βββ service.py # Business logic orchestrator
β β β βββ middleware.py # Request ID & correlation middleware
β β β βββ error_models.py # Standard error response model
β β βββ database/
β β β βββ database.py # SQLAlchemy engine & session
β β β βββ models.py # ORM models
β β β βββ repository.py # Data access layer
β β βββ evaluation/
β β β βββ collector.py # Evaluation record collector
β β β βββ metrics.py # Evaluation metrics calculations
β β β βββ models.py # Evaluation record schema
β β β βββ repository.py # JSONL-backed evaluation persistence
β β βββ services/
β β β βββ health_service.py # Dependency health checks
β β β βββ metrics_service.py # Metrics aggregation
β β β βββ version_service.py # Version info
β β βββ config.py # Configuration (backward-compatible)
β β βββ settings.py # Pydantic Settings (centralized config)
β β βββ schema.py # TicketExtraction Pydantic schema
β β βββ extraction.py # Extraction & repair loop
β β βββ preprocessing.py # Text cleaning & PII redaction
β β βββ confidence.py # Confidence scoring
β β βββ metadata.py # Extraction metadata builder
β β βββ logging.py # Structured JSON logging
β β βββ repair_logging.py # Repair attempt logging
β βββ tests/
β β βββ conftest.py # Shared fixtures & test configuration
β β βββ test_api.py # API endpoint tests
β β βββ test_schema.py # Schema validation tests
β β βββ test_repair_loop.py # Repair loop tests
β β βββ test_database.py # Database operation tests
β β βββ test_utilities.py # Utility module tests
β β βββ test_error_handling.py # Error handling tests
β β βββ test_integration_mocked.py # Mocked integration tests
β β βββ test_evaluation.py # Evaluation module tests
β βββ scripts/ # Utility scripts
β βββ data/ # Data files (CSV, JSONL, SQLite)
β βββ reports/ # Evaluation reports
β βββ Dockerfile # Multi-stage Docker build
β βββ requirements.txt # Production dependencies
β βββ requirements-dev.txt # Development dependencies
β βββ pyproject.toml # Tool configuration
β βββ pytest.ini # Pytest configuration
β
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ lib/ # API client & utilities
β β βββ assets/ # Static assets
β βββ Dockerfile
β βββ package.json
β βββ vite.config.ts
β βββ tailwind.config.js
β
βββ dashboard/
β βββ app.py # Streamlit app
β βββ analytics.py # Analytics components
β βββ charts.py # Chart components
β βββ config.py # Dashboard config
β
βββ docs/
β βββ architecture.png # Architecture diagram
β βββ architecture.md # Architecture documentation
β βββ api.md # API documentation
β βββ api_examples.md # API examples
β βββ banner.png # Project banner
β βββ changelog.md # Release history
β βββ code_of_conduct.md # Code of conduct
β βββ contributing.md # Contributing guide
β βββ deployment.md # Deployment guide
β βββ logo.png # Project logo
β βββ model-card.md # Model card
β βββ observability.md # Observability guide
β βββ roadmap.md # Roadmap
β βββ screenshots/ # Application screenshots
β βββ security.md # Security guide
β βββ workflow.md # Workflow documentation
β βββ adr/ # Architecture decision records
β βββ reports/ # Documentation reports
β βββ audit_report.md
β βββ benchmark.md
β βββ evaluation.md
β βββ failure_analysis.md
β βββ metric_verification_report.md
β βββ performance.md
β βββ project_metrics.md
β
βββ reports/ # Generated outputs
β
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI pipeline
β
βββ docker-compose.yml # Multi-service orchestration
βββ .pre-commit-config.yaml # Pre-commit hooks
βββ .editorconfig # Editor configuration
βββ .gitignore # Git ignore rules
βββ .dockerignore # Docker ignore rules
βββ README.md # This file
βββ LICENSE # MIT License
β Global Exception Handling
β Request IDs
β Correlation IDs
β Structured Logging
β Environment Configuration
β Health Monitoring
β Version Endpoint
β Metrics API
β Batch Processing
β Docker Support
β REST API Documentation
- Python 3.12+
- Node.js 20+
- An API key from Groq or Featherless AI
git clone https://github.com/RaihanBasha7/ExtractIQ-Engine.git
cd ExtractIQ-Enginecd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtcp .env.example .envEdit .env and add your API key:
LLM_PROVIDER=featherless
FEATHERLESS_API_KEY=fl_your_key_here
FEATHERLESS_MODEL=deepseek-ai/DeepSeek-V4-Pro
FEATHERLESS_BASE_URL=https://api.featherless.ai/v1
MAX_REPAIR_RETRIES=3To switch to Groq as the provider, change LLM_PROVIDER=groq and set GROQ_API_KEY and GROQ_MODEL instead.
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
npm install
npm run dev| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| API Docs | http://localhost:8000/docs |
| Dashboard | http://localhost:8501 |
Note on example responses: The JSON response bodies below show the expected structure and field types. Numeric values (response times, latency, confidence) are illustrative and will vary based on provider, network conditions, and input complexity. See
docs/reports/benchmark.mdfor actual measured values.
GET /healthResponse:
{
"status": "healthy",
"timestamp": "2026-07-20T10:30:00Z",
"response_time_ms": 12.34,
"checks": {
"api": { "status": "ok", "response_time_ms": 0.1 },
"database": { "status": "ok", "response_time_ms": 1.2 },
"llm_provider": { "status": "ok", "response_time_ms": 5.0, "provider": "featherless", "model": "deepseek-ai/DeepSeek-V4-Pro" },
"disk": { "status": "ok", "response_time_ms": 0.3 }
}
}GET /versionResponse:
{
"service": "OneInbox API",
"version": "0.1.0",
"api_version": "v1",
"provider": "featherless",
"model": "google/gemma-4-31B-it",
"environment": "development",
"python_version": "3.12.4",
"timestamp": "2026-07-20T10:30:00Z"
}POST /v1/extract
Content-Type: application/json
{
"ticket_id": "TKT-001",
"raw_text": "From: John Doe <[email protected]>\nSubject: Need help\n\nI can't log into my account. It says 'invalid password'. Help!"
}Response:
{
"ticket_id": "TKT-001",
"success": true,
"data": {
"ticket_id": "TKT-001",
"customer": { "name": "John Doe", "account_id": null },
"issue": {
"category": "account",
"subcategory": "login failure",
"product_or_service": null,
"urgency": "high"
},
"sentiment": "frustrated",
"entities": { "order_ids": [], "dates_mentioned": [], "amounts_mentioned": [] },
"requested_action": "help with login",
"resolution_status": "unresolved"
},
"confidence": 0.85,
"metadata": {
"repair_attempts": 0,
"latency_ms": 450,
"provider": "featherless",
"model": "deepseek-ai/DeepSeek-V4-Pro",
"validation": "passed",
"timestamp": "2026-07-20T10:30:00Z"
},
"retry_count": 0,
"latency_seconds": 0.45,
"language": "en",
"request_id": "REQ-000001",
"cleaned_text": "From: John Doe <[REDACTED_EMAIL]>\nSubject: Need help\n\nI can't log into my account...",
"repair_attempts": []
}POST /v1/extract/batch
Content-Type: application/json
{
"tickets": [
{ "ticket_id": "TKT-001", "raw_text": "Need help with my order" },
{ "ticket_id": "TKT-002", "raw_text": "Account locked, please help" }
]
}GET /v1/history?limit=10&offset=0GET /v1/metricsGET /v1/systemThe project uses pytest for testing.
cd backend
# Run all tests
python -m pytest
# With coverage report
python -m pytest --cov=app --cov-report=term
# With HTML coverage report
python -m pytest --cov=app --cov-report=html
# Run specific test file
python -m pytest tests/test_api.py
# Run tests by marker
python -m pytest -m "unit"
python -m pytest -m "integration"
# Verbose output
python -m pytest -v| Test File | Coverage |
|---|---|
test_api.py |
API endpoints (health, version, metrics, history, extract, batch) |
test_schema.py |
Schema validation, enums, nested objects, optional fields |
test_repair_loop.py |
Repair loop execution, retry counting, error classification |
test_database.py |
CRUD operations, metrics aggregation, history retrieval |
test_utilities.py |
Text cleaning, PII stripping, request ID, confidence, metadata |
test_error_handling.py |
Error responses, exception handlers, validation errors |
test_integration_mocked.py |
End-to-end pipeline with mocked LLM |
test_evaluation.py |
Evaluation records, metrics, repository |
# Format code
black --line-length=120 app/ tests/
# Sort imports
isort --profile=black app/ tests/
# Lint
flake8 app/ tests/
# Type check
mypy app/# Build the backend image
docker build -t extractiq-engine -f backend/Dockerfile .
# Run the container
docker run -p 8000:8000 \
-e LLM_PROVIDER=featherless \
-e FEATHERLESS_API_KEY=your_key \
-e FEATHERLESS_MODEL=deepseek-ai/DeepSeek-V4-Pro \
-e FEATHERLESS_BASE_URL=https://api.featherless.ai/v1 \
extractiq-engine# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downThis starts:
- Backend on port 8000
- Frontend on port 5173
- Health checks ensure proper startup order
| Layer | Platform |
|---|---|
| Frontend | Vercel |
| Backend | Render |
| Database | SQLite (PostgreSQL Ready) |
| API | FastAPI |
| AI Provider | Featherless AI |
- [β ] PostgreSQL support (via SQLAlchemy)
- [β ] Authentication & API keys
- [β ] Rate limiting middleware
- [β ] Request validation improvements
- Multi-provider LLM routing (LiteLLM)
- Redis queue + Celery workers
- Webhook notifications
- Human review dashboard
- Export integration (CSV, JSON, PDF)
- Kubernetes deployment
- AWS/GCP deployment
- Real-time monitoring (Prometheus + Grafana)
- Active learning loop
- Multi-language schema support
- A/B testing framework
- SQLite β Suitable for development/small-scale. For production, migrate to PostgreSQL.
- Process-local request IDs β Current REQ-XXXXXX generator resets on restart. Use UUIDv7 for distributed deployments.
- Rate limits β Free-tier LLM providers have daily token limits. Consider upgrading or adding provider failover.
- Single-worker β The repair loop runs synchronously. For high throughput, implement Celery workers.
- Language detection β Uses
langdetectwhich may not detect all languages accurately. - No authentication β API endpoints are currently open. Add authentication before production deployment.
- Built for OneInbox AI Engineer Internship Hackathon 2026
- Production-inspired AI extraction architecture
- Strict Pydantic schema enforcement
- Model-Driven Repair Loop
- Interactive analytics dashboard
- RESTful API with OpenAPI documentation
- Dockerized deployment
- Modular FastAPI backend
Shaik Raihan Basha
B.Tech CSE | AI/ML Engineer
- GitHub: @RaihanBasha7
- LinkedIn: Shaik Raihan Basha
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
MIT License β Copyright (c) 2026 Shaik Raihan Basha
See LICENSE for full details.
Copyright (c) 2026 Shaik Raihan Basha

