Download README.md from mrmayankmathurorg/Customer-EMAIL-Agent: direct link, hf CLI and curl.
- Browser
- Download file 4.61 kB
-
https://huggingface.co/spaces/mrmayankmathurorg/Customer-EMAIL-Agent/resolve/main/README.md
- Command line
-
hf download hf://spaces/mrmayankmathurorg/Customer-EMAIL-Agent/README.md
-
curl -L -o README.md https://huggingface.co/spaces/mrmayankmathurorg/Customer-EMAIL-Agent/resolve/main/README.md
title: Customer EMAIL Agent
emoji: π§
colorFrom: blue
colorTo: indigo
sdk: docker
pinned: false
π§ Customer Support Email Agent
An AI-powered customer support email agent built with LangGraph, LangChain, and FastAPI.
The agent automatically classifies incoming support emails, retrieves relevant knowledge, drafts responses, and optionally escalates complex issues β all orchestrated as a stateful LangGraph workflow.
Architecture
Incoming Email
β
βΌ
βββββββββββββββ
β Classifier β β Categorizes intent (billing, technical, general, etc.)
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Retriever β β Fetches relevant knowledge base articles
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Responder β β Drafts a reply using context + LLM
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββ
β Escalation β β Routes to human agent if confidence is low
βββββββββββββββ
Project Structure
cust_support_system/
βββ src/
β βββ main.py # FastAPI application entry point
β βββ api/ # API routes & dependencies
β βββ core/ # Config, logging, constants
β βββ graph/ # LangGraph workflow definition
β βββ nodes/ # Individual graph nodes
β βββ schemas/ # Pydantic models
β βββ services/ # Email & LLM services
β βββ prompts/ # Prompt templates
β βββ utils/ # Helper utilities
βββ knowledge_base/ # Support articles & FAQ docs
βββ tests/ # Pytest test suite
βββ requirements.txt
βββ .env.example # Credential-free configuration template
βββ README.md
Setup
# 1. Create & activate a virtual environment (Python 3.12)
python3.12 -m venv venv
source venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure environment variables
cp .env.example .env # then fill in your keys
# 4. Run the server
uvicorn src.main:app --reload
OpenAI inference configuration
Chat and knowledge-base embeddings use the backend-only OPENAI_API_KEY:
OPENAI_API_KEY=your-openai-api-key
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-6-luna
EMBEDDING_MODEL=text-embedding-3-small
The chat model ID gpt-6-luna is passed through exactly as configured.
Its availability and API compatibility have not been verified; it must be
accessible on your OpenAI account. The application no longer uses GITHUB_TOKEN
for inference. Do not use a GitHub token as an OpenAI key or expose provider keys
in frontend VITE_* variables.
For an existing installation, update the provider entries in .env rather than
replacing the file and losing unrelated credentials. Environment variables take
precedence over .env, which takes precedence over the code defaults. On your
backend host (for example, Hugging Face Spaces), set OPENAI_API_KEY as a secret
and update or remove stale LLM_BASE_URL, LLM_MODEL, and EMBEDDING_MODEL
overrides. Restart the backend after configuration changes. /config reports
the effective chat model; it does not modify inference settings.
Embeddings remain on the text-embedding-3-small model family with default
dimensions. The migration does not rebuild the FAISS index. If the old index used
a different embedding model or dimensions, rebuild it explicitly with
python -m src.services.kb_service after setting a valid key; that command makes
billable embedding requests.
Backend API authentication
Set API_TOKEN in the backend environment to a long random value. Production
startup fails when APP_ENV=production and the token is missing. For local
development, the frontend sends the same value from frontend/.env as
VITE_API_TOKEN; this value is visible to browser users and should not be
treated as a production-grade user authentication secret.
Tech Stack
| Layer | Technology |
|---|---|
| LLM | OpenAI (gpt-6-luna) |
| Orchestration | LangGraph + LangChain |
| API | FastAPI |
| Validation | Pydantic v2 |
| Language | Python 3.12 |