This project is a FastAPI-based microservices system that performs diagnosis, curriculum planning, prediction, and data ingestion for AI-driven skill gap analysis.
It follows a gateway + microservices architecture:
ai-skill-gap-full/
│
├── gateway/ # API Gateway - central entry point
├── diagnose/ # Diagnose service
├── curriculum/ # Curriculum planner service
├── predict/ # Prediction service
├── ingestion/ # Data ingestion service
├── docker-compose.yml
└── README.md
- Gateway Service (port 8080): Handles requests and routes them to appropriate services
- Diagnose Service (port 8001): Analyzes student profiles and gaps
- Curriculum Service (port 8002): Generates personalized learning curriculum
- Predict Service (port 8003): Provides predictions based on progress
- Ingestion Service (port 8004): Handles external data ingestion
- Python 3.9+ (tested with Python 3.11)
- FastAPI + Uvicorn
- HTTPX for async HTTP calls
- Docker & Docker Compose (optional but recommended)
git clone https://github.com/yourusername/ai-skill-gap-full.git
cd ai-skill-gap-fullpython -m venv venvActivate it:
- Windows:
venv\Scripts\activate- Linux/Mac:
source venv/bin/activatepip install -r requirements.txtYou have two options to run:
Open separate terminals and run:
# Terminal 1 → Gateway
uvicorn gateway.main:app --reload --port 8080
# Terminal 2 → Diagnose
uvicorn diagnose.main:app --reload --port 8001
# Terminal 3 → Curriculum
uvicorn curriculum.main:app --reload --port 8002
# Terminal 4 → Predict
uvicorn predict.main:app --reload --port 8003
# Terminal 5 → Ingestion
uvicorn ingestion.main:app --reload --port 8004Make sure you have Docker & Docker Compose installed.
Then simply run:
docker-compose up --buildThis will spin up all services in one go 🎉
Gateway (http://localhost:8080)
GET /health→ Health checkPOST /diagnose→ Send student profile & responsesPOST /curriculum→ Generate curriculum planPOST /predict→ Get predictionsPOST /ingest→ Ingest external data
Request:
GET http://localhost:8080/healthResponse:
{
"status": "ok",
"service": "gateway"
}Request:
POST http://localhost:8080/diagnose
Content-Type: application/jsonBody:
{
"student_profile": {"id": "s-123", "locale": "en-US"},
"context": {"subject": "math", "taxonomy_version": "v3", "window_days": 28},
"responses": [
{"item_id": "i123", "type": "msq", "answer": ["A", "C"], "time_sec": 45}
]
}Response:
{
"mastery_vector": [{"skill_id":"skill:fractions.add","score":0.56}],
"gaps": ["fractions"]
}Request:
POST http://localhost:8080/curriculum
Content-Type: application/jsonBody:
{
"mastery_vector": [{"skill_id":"skill:fractions.add","score":0.56}],
"constraints": {"pace_minutes_per_day": 30, "modality": ["video","practice"]}
}Response:
{
"plan": [
{"objective": "Improve Fractions", "activity": "Watch video lesson", "duration": 20}
]
}Request:
POST http://localhost:8080/predict
Content-Type: application/jsonBody:
{
"student_profile": {"id": "s-123"},
"context": {"subject": "math"}
}Response:
{
"prediction": "pass",
"confidence": 0.87
}Request:
POST http://localhost:8080/ingest
Content-Type: multipart/form-dataForm Data:
dataset: (file upload)source: "manual"
Response:
{
"status": "success",
"message": "File ingested successfully"
}-
Warning:
model_config['protected_namespaces']
→ Fix: Add this in all Pydantic models:model_config = {"protected_namespaces": ()}
-
Error:
httpx.ConnectError: All connection attempts failed
→ Fix: Make sure all microservices (diagnose,curriculum,predict,ingestion) are running. -
404 on
/
→ Default FastAPI root path not defined. Use/docsor/health.
Once services are running, visit:
- Gateway → http://localhost:8080/docs
- Diagnose → http://localhost:8001/docs
- Curriculum → http://localhost:8002/docs
- Predict → http://localhost:8003/docs
- Ingestion → http://localhost:8004/docs