EnterpriseFlow Copilot is an enterprise AI workflow assistant demo for internal policy Q&A and process handling. It combines document ingestion, retrieval-augmented answers, agent-driven task creation, and a dashboard-style frontend into one interview-ready project.
- Imports internal policy and process documents into a searchable knowledge base
- Answers policy questions with source-backed retrieval results
- Lets an agent create and track workflow tasks such as reimbursement flows
- Shows recent execution logs and task progress in a workspace UI
- Falls back to demo mode when the backend is offline so the frontend still looks complete
- Python
- FastAPI
- SQLModel
- SQLite
- httpx
- scikit-learn
- pypdf
- React 19
- Vite
- Tailwind CSS 4
- RAG-style retrieval over enterprise documents
- OpenAI-compatible API support
- Mock LLM fallback for local demos
- Rule-based agent tool calling
backend/ FastAPI backend, services, routers, tests
frontend/ React + Vite frontend workspace
demo_docs/ Sample enterprise policy/process documents
scripts/ Demo import and smoke-test scripts
data/ Local uploaded files during runtime
netlify.toml Netlify deployment config for the frontend demo
- Python 3.11+
- Node.js 20+
- npm 10+
cd D:\codexshengcheng\EnterpriseFlow\backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtcd D:\codexshengcheng\EnterpriseFlow\frontend
npm installCopy the example file:
cd D:\codexshengcheng\EnterpriseFlow
Copy-Item .env.example .envCommon variables:
APP_NAME=EnterpriseFlow Copilot
APP_VERSION=0.1.0
ENVIRONMENT=development
LOG_LEVEL=INFO
DATABASE_URL=sqlite:///./data/app.db
LLM_PROVIDER=mock
LLM_BASE_URL=
LLM_API_KEY=
LLM_MODEL=gpt-4o-mini
ALLOW_MOCK_LLM_FALLBACK=true
UPLOAD_DIR=./data/uploads
VITE_API_BASE_URL=http://127.0.0.1:8000Notes:
LLM_PROVIDER=mockis the easiest local setup.- If you connect a real model, provide
LLM_API_KEYthrough environment variables. - Using
127.0.0.1consistently helps avoid local CORS mismatch issues.
cd D:\codexshengcheng\EnterpriseFlow\backend
.venv\Scripts\activate
uvicorn app.main:app --reloadEndpoints:
- Health: http://127.0.0.1:8000/health
- Swagger: http://127.0.0.1:8000/docs
cd D:\codexshengcheng\EnterpriseFlow\frontend
npm run devFrontend:
Included sample documents:
差旅报销制度.md请假审批流程.md办公用品采购流程.md新员工入职指南.md
Import them with:
cd D:\codexshengcheng\EnterpriseFlow
python scripts\seed_demo.pyWith the backend running:
cd D:\codexshengcheng\EnterpriseFlow
python scripts\smoke_test.pyOr:
python scripts\smoke_test.py http://127.0.0.1:8000Checks covered:
GET /healthGET /documentsPOST /chat/agentPOST /tasksGET /tasks/{id}/statusGET /logs
cd D:\codexshengcheng\EnterpriseFlow\backend
.venv\Scripts\activate
python -m unittest discover testsThe repository includes Netlify config for a frontend-only demo deployment.
Live demo:
Important:
- This online version is a stable demo frontend.
- It runs with backend-disabled demo mode.
- The FastAPI backend is intended for local use or separate Python hosting.
- Start the backend.
- Run
python scripts\seed_demo.py. - Start the frontend.
- Ask:
差旅报销需要准备哪些材料? - Show the cited answer and source cards.
- Ask the agent to create a reimbursement task.
- Show the task board and execution timeline.
- Built an enterprise AI copilot for internal policy Q&A and workflow handling with retrieval, agent tool calling, task orchestration, and execution trace visibility.
- Developed a FastAPI + SQLModel + SQLite backend for document ingestion, retrieval, task routing, and logging.
- Designed a React + Vite frontend workspace with graceful demo-mode fallback for stable live demos.
- Retrieval is lightweight and optimized for demos, not large-scale production search.
- The public Netlify deployment does not include the Python backend.
- PDF extraction quality depends on local parser availability.
This repository is currently positioned for personal portfolio and demo use. Add a formal open-source license before broader distribution if needed.