Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnterpriseFlow Copilot

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.

What It Does

  • 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

Stack

Backend

  • Python
  • FastAPI
  • SQLModel
  • SQLite
  • httpx
  • scikit-learn
  • pypdf

Frontend

  • React 19
  • Vite
  • Tailwind CSS 4

AI Layer

  • RAG-style retrieval over enterprise documents
  • OpenAI-compatible API support
  • Mock LLM fallback for local demos
  • Rule-based agent tool calling

Project Structure

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

Requirements

  • Python 3.11+
  • Node.js 20+
  • npm 10+

Backend Setup

cd D:\codexshengcheng\EnterpriseFlow\backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Frontend Setup

cd D:\codexshengcheng\EnterpriseFlow\frontend
npm install

Environment Variables

Copy the example file:

cd D:\codexshengcheng\EnterpriseFlow
Copy-Item .env.example .env

Common 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:8000

Notes:

  • LLM_PROVIDER=mock is the easiest local setup.
  • If you connect a real model, provide LLM_API_KEY through environment variables.
  • Using 127.0.0.1 consistently helps avoid local CORS mismatch issues.

Run Locally

Start backend

cd D:\codexshengcheng\EnterpriseFlow\backend
.venv\Scripts\activate
uvicorn app.main:app --reload

Endpoints:

Start frontend

cd D:\codexshengcheng\EnterpriseFlow\frontend
npm run dev

Frontend:

Demo Data

Included sample documents:

  • 差旅报销制度.md
  • 请假审批流程.md
  • 办公用品采购流程.md
  • 新员工入职指南.md

Import them with:

cd D:\codexshengcheng\EnterpriseFlow
python scripts\seed_demo.py

Smoke Test

With the backend running:

cd D:\codexshengcheng\EnterpriseFlow
python scripts\smoke_test.py

Or:

python scripts\smoke_test.py http://127.0.0.1:8000

Checks covered:

  1. GET /health
  2. GET /documents
  3. POST /chat/agent
  4. POST /tasks
  5. GET /tasks/{id}/status
  6. GET /logs

Backend Tests

cd D:\codexshengcheng\EnterpriseFlow\backend
.venv\Scripts\activate
python -m unittest discover tests

Deployment

The 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.

Recommended Demo Script

  1. Start the backend.
  2. Run python scripts\seed_demo.py.
  3. Start the frontend.
  4. Ask: 差旅报销需要准备哪些材料?
  5. Show the cited answer and source cards.
  6. Ask the agent to create a reimbursement task.
  7. Show the task board and execution timeline.

Resume-Friendly Description

  • 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.

Known Limits

  • 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.

License

This repository is currently positioned for personal portfolio and demo use. Add a formal open-source license before broader distribution if needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages