CoolFace
Apppublic

aditya1401/mft-operations-agent

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
App README

An AI-powered operations assistant for MFT/EDI support engineers. Built with LangGraph, FastAPI, and LLaMA 3.3 via Groq.

Demo

Ask the agent about trading partner details, transfer failures, SLA breaches, onboarding status, escalations โ€” it looks up real docs and gives actionable responses.

[image]

๐Ÿ”— Live: https://huggingface.co/spaces/aditya1401/mft-operations-agent


Architecture

mermaid
flowchart TD
    User(["๐Ÿ‘ค Support Engineer"])
    UI["HTML Chat UI\nstatic/index.html"]
    API["FastAPI Backend\napp.py\nPOST /chat  /reset  /health"]
    Agent["MFTAgent\nagent.py\nLangGraph create_react_agent\nLLaMA 3.3 70B via Groq"]

    subgraph Tools ["โš™๏ธ 8 LangChain Tools โ€” tools.py"]
        T1["get_tp_details"]
        T2["check_transfer_status"]
        T3["detect_sla_breaches"]
        T4["get_onboarding_status"]
        T5["get_pending_followups"]
        T6["search_knowledge_base"]
        T7["draft_escalation_email"]
        T8["generate_onboarding_checklist"]
    end

    subgraph Data ["๐Ÿ“ Data Sources โ€” docs/"]
        D1["tp_master_list.xlsx\n(TP directory)"]
        D2["onboarding_tracker.xlsx\n(onboarding pipeline)"]
        D3["mft_procedures.txt\nescalation_guide.pdf\nmft_rules.docx"]
        D4["ChromaDB\n(vector index)"]
        D5["followups.db\n(SQLite)"]
    end

    User --> UI --> API --> Agent --> Tools
    T1 & T2 & T3 & T7 --> D1
    T4 --> D2
    T6 --> D4
    D4 -. "indexed from" .-> D3
    T5 --> D5

Features

  • โ€”TP Lookup โ€” Trading partner details, Job Owner, protocol, connection type, and password reset policy
  • โ€”Transfer Status โ€” Latest file transfer status with error diagnosis and recommended actions
  • โ€”SLA Breach Detection โ€” Flags breached and at-risk TPs by protocol threshold (SFTP=4h, AS2=2h, FTPS=6h)
  • โ€”Onboarding Tracker โ€” Live stage tracking from onboarding_tracker.xlsx with OVERDUE alerts
  • โ€”Pending Follow-ups โ€” Overdue and escalated items from SQLite tracker
  • โ€”Knowledge Base Search โ€” Semantic vector search over MFT SOPs using ChromaDB + RAG
  • โ€”Escalation Drafting โ€” Professional escalation emails with TP context and password reset warnings
  • โ€”Onboarding Checklist โ€” Protocol-specific setup steps for new trading partners

Tech Stack

LayerTechnology
LLMLLaMA 3.3 70B via Groq
Agent FrameworkLangGraph create_react_agent
Vector SearchChromaDB + sentence-transformers
BackendFastAPI + Uvicorn
FrontendHTML / CSS / Vanilla JS
Doc Parsingopenpyxl, pdfplumber, python-docx
DatabaseSQLite (follow-up tracker)
DeploymentDocker on Hugging Face Spaces

Tools

ToolDescription
get_tp_detailsTP lookup by ID or name โ€” returns protocol, connection type, JO, password reset policy
check_transfer_statusLatest transfer status with error codes and recommended actions
detect_sla_breachesSLA monitoring โ€” flags breached and at-risk TPs by protocol threshold
get_onboarding_statusOnboarding stage tracker โ€” reads live from onboarding_tracker.xlsx
get_pending_followupsOverdue/escalated items from SQLite follow-up tracker
search_knowledge_baseSemantic search via ChromaDB โ€” finds relevant SOPs and procedures
draft_escalation_emailAuto-drafted escalation email with TP context and password reset warning
generate_onboarding_checklistProtocol-specific onboarding checklist for new TPs

Setup

Prerequisites

Installation

bash
git clone https://github.com/adii1401/mft-operations-agent.git
cd mft-operations-agent
pip install -r requirements.txt

Configuration

Create a .env file:

env
GROQ_API_KEY=your_groq_api_key_here

Run

bash
python app.py

Open http://localhost:7860


Project Structure

mft-operations-agent/
โ”œโ”€โ”€ app.py                      โ† FastAPI backend
โ”œโ”€โ”€ agent.py                    โ† LangGraph agent with LLaMA 3.3
โ”œโ”€โ”€ tools.py                    โ† 8 LangChain tools
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ .dockerignore
โ”œโ”€โ”€ .env                        โ† API keys (not committed)
โ”œโ”€โ”€ chroma_db/                  โ† Vector index (auto-generated)
โ”œโ”€โ”€ static/
โ”‚   โ””โ”€โ”€ index.html              โ† Dark theme chat UI
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ tp_master_list.xlsx
    โ”œโ”€โ”€ onboarding_tracker.xlsx
    โ”œโ”€โ”€ mft_procedures.txt
    โ”œโ”€โ”€ escalation_guide.pdf
    โ””โ”€โ”€ mft_rules.docx

Notes

  • โ€”ChromaDB embedding model is pre-downloaded at Docker build time โ€” no cold start failures
  • โ€”Groq free tier: 100k tokens/day. Vector search reduces token usage ~80% vs full-doc loading
  • โ€”SLA thresholds are protocol-based: SFTP=4h, AS2=2h, FTPS=6h
  • โ€”Onboarding tracker reads live from onboarding_tracker.xlsx โ€” update the file to reflect real pipeline
  • โ€”Agent recursion limited to 10 steps to prevent infinite tool loops

Related Projects

  • โ€”MFT Email Responder โ€” Project 1: AI-powered email triage and response with RAG + Microsoft Graph API

Built as part of an AI Automation Engineer portfolio.