An intelligent, agentic IT support system designed for Veridian Corp. This project demonstrates a professional, full-stack AI agent capable of understanding employee issues, retrieving relevant company policies, making reasoned decisions based on historical precedents, and managing an integrated IT ticketing system.
The system acts as an automated first-line IT support engineer. Unlike a standard chatbot, it employs an Agentic Workflow to ensure that every response is grounded in company policy and consistent with previous decisions.
Employee Request
- Natural Language Understanding: Automatically classifies user requests into specific IT categories using LLM-based intent detection.
- Grounded Reasoning (RAG): Implements a Retrieval-Augmented Generation (RAG) pattern using a curated Knowledge Base (KB) to prevent AI hallucinations.
- Context-Aware Decisions: Analyzes historical ticket data to maintain consistency in approvals, rejections, and resolution paths.
- Secure Admin Dashboard: A protected management area for IT admins to track tickets, review full audit trails, and manage policy grounding.
- Automated Ticketing: Intelligently decides when a request can be self-serviced vs. when it requires a structured IT ticket for human intervention.
- Professional Full-Stack UI: Modern web frontend built with HTML, CSS, and JavaScript, powered by a high-performance FastAPI backend.
| File | Description |
|---|---|
main.py |
Entry Point. FastAPI server handling routing, static file serving, and API endpoints for support and admin management. |
agent.py |
The Brain. Orchestrates the AI workflow. Handles LLM-based classification, decision-making, and response generation via the Ollama API. |
retriever.py |
Knowledge Fetcher. Implements a hybrid retrieval strategy (Category Mapping policies.json. |
database.py |
Data Layer. Manages the SQLite database (veridian_it.db) for tickets, audit logs, and system settings. |
auth_utils.py |
Security. Provides secure password hashing and verification using the bcrypt library. |
set_admin_password.py |
Setup Utility. Standalone script to securely initialize or update the admin dashboard password. |
seed_tickets.py |
Data Utility. Populates the database with historical ticket data from tickets.json to provide context for the AI. |
| File | Description |
|---|---|
policies.json |
Knowledge Base. The "Ground Truth" containing official Veridian Corp IT policies (KB-01 to KB-10). |
tickets.json |
Historical Data. A dataset of past tickets used to seed the database and provide precedent for the AI's reasoning. |
requirements.txt |
Dependencies. Required Python libraries (FastAPI, Uvicorn, Requests, Bcrypt, Python-Dotenv). |
.env |
Environment Variables. Configuration for the Ollama API (Base URL, Model, and API Key). |
| File | Description |
|---|---|
static/index.html |
UI Structure. The main interface featuring the chat portal and the Admin Dashboard. |
static/style.css |
Styling. Modern corporate aesthetic with a responsive layout. |
static/script.js |
Frontend Logic. Handles API communication, session management, and dynamic DOM updates. |
# Install required dependencies
pip install -r requirements.txtCreate a .env file in the root directory. The system defaults to llama3 via Ollama:
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_API_KEY=your_api_key_here (optional)
OLLAMA_MODEL=llama3Before starting the server, you must set the admin password and seed the database with historical context:
# Set the password for the Admin Dashboard
python set_admin_password.py
# Populate the database with historical precedents
python seed_tickets.pypython main.pyVisit http://127.0.0.1:8000 in your browser to access the portal.
To manage the system:
- Navigate to the Admin tab in the web portal.
- Enter the password created during the setup step.
- Manage Tickets, review the Audit Trail, and browse the Knowledge Base.
| Endpoint | Method | Description | Access |
|---|---|---|---|
/api/support/request |
POST |
Submit a support request to the AI Agent | Public |
/api/support/my-tickets |
GET |
Get tickets for a specific employee email | Public |
/api/admin/login |
POST |
Authenticate admin and receive session token | Public |
/api/support/tickets |
GET |
List all system tickets | Admin |
/api/support/audit |
GET |
Retrieve the full agent audit trail | Admin |
/api/support/policies |
GET |
Retrieve the current knowledge base | Admin |