Enterprise-grade AI Decision Support System built with LangGraph state orchestration, Authoritative RAG, Historical Decision Modeling, Deterministic Confidence Scoring, and Cost Governance controls. Designed as a structured decision engine — not a chatbot.
Visit Live Demo View on GitHub
AI Decision Agent is a production-oriented AI governance prototype designed to support structured decision-making in enterprise-like environments. Built with Python 3.11, LangGraph, LangChain, OpenAI models, and ChromaDB, it implements a deterministic multi-stage workflow (Intake → RAG → Historical Retrieval → Analyzer → Planner → Decision → Confidence → Report). The system separates reasoning layers to reduce bias, integrates authoritative organizational documents via RAG, models historical influence through semantic similarity, computes confidence deterministically outside the LLM, and enforces strict token budget governance for public cloud deployment on Hugging Face Spaces.
The system is implemented as a deterministic state machine using LangGraph. Each decision request flows through explicit nodes: intake normalization, authoritative RAG retrieval, historical memory lookup, independent analysis, structured planning, decision synthesis, confidence modeling, and report generation. Each node owns specific state fields and produces a semantically complete state when executed. This architecture avoids hidden coupling and ensures traceability across the entire reasoning pipeline.
Organizational documents can be uploaded and treated as authoritative constraints. Documents are embedded and stored in ChromaDB, retrieved via semantic similarity, and injected into the decision context. The system explicitly distinguishes between authoritative context (organizational truth) and historical decisions (precedent evidence). This reduces hallucinations and enforces alignment with real-world business constraints.
The system maintains long-term semantic memory of past decisions. Similarity-based retrieval identifies related historical cases and computes an influence factor that adjusts final confidence. This allows the engine to quantify precedent impact rather than merely referencing it, moving toward AI governance rather than simple generation.
Confidence is not taken from the LLM. Instead, the system computes base confidence, applies historical influence adjustments, and derives a final deterministic score with explicit label mapping. Low-confidence outcomes can trigger retries or fallback handling. Confidence drift tracking allows monitoring changes over time, separating generative output from evaluation metrics.
Every session generates a structured report including decision outcome, reasoning, contextual evidence, historical influence, and full confidence breakdown. Reports are exportable in HTML, PDF, and DOCX formats, supporting governance workflows and executive-level documentation requirements.
A dedicated Token Budget Manager enforces session-level and daily limits to control cloud costs in the public Hugging Face deployment. Quota exhaustion leads to explicit refusal rather than uncontrolled LLM calls. Logging is performed at node level via a decorator-based system, ensuring traceable execution and easier debugging in production-like environments.