Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PathSync AI πŸŽ“

AI-powered scholarship discovery, matching, and application system for Nigerian university students.

Python FastAPI React Anthropic Supabase License


The Problem

Nigeria has 1.8 million active undergraduates and over ₦50 billion in scholarship funds that go unclaimed every year β€” not because the money doesn't exist, but because students and funders can't find each other.

Most Nigerian students lose scholarships not because they don't qualify β€” but because they can't describe themselves properly. A student who runs a street football league doesn't know that's Project Coordination and Community Leadership. A student who manages their church's social media doesn't know that's Digital Communications and Community Engagement.

PathSync AI fixes that.


What PathSync AI Does

1. πŸ’¬ Discovery Interview

A student has a real conversation with Claude (Anthropic's AI). The AI conducts a structured interview β€” asking about CGPA, course, and crucially, what the student does outside lectures.

2. 🧠 Hidden Achievement Engine

PathSync translates everyday student language into formal, fundable competencies:

What the student says What PathSync hears
"I run a street football league" Project Coordination & Community Leadership
"I manage my church's social media" Digital Communications & Community Engagement
"I tutor my classmates in maths" Peer Education, Mentorship & Curriculum Delivery
"I do small business selling provisions" Entrepreneurship & Financial Management
"I'm the class rep" Student Government & Stakeholder Liaison

3. 🎯 Scholarship Matching

RAG-based vector similarity search across a live knowledge base of Nigerian scholarships β€” MTN Foundation, Shell Nigeria, NLNG, TETFUND and more β€” matching the student's full profile, not just keywords.

4. βœ‰οΈ Application Letter Generator

One click generates a complete, personalised, formal scholarship application letter using everything Claude learned about the student in the interview.

5. πŸ“„ CV Generator

Automatically builds a scholarship-optimised CV β€” translating every informal activity into a professional competency.

6. πŸ“… Deadline Tracker

A personalised action plan for every matched scholarship β€” specific steps, documents needed, and days remaining.

7. πŸ”’ Privacy Gateway

All student input passes through a two-layer PII scrubber before touching any LLM:

  • Regex layer β€” strips Nigerian phone numbers, NIN, BVN, emails, addresses
  • spaCy NER layer β€” removes PERSON, LOC, GPE entities

Only Academic DNA (CGPA, major, skills, achievements) reaches the AI.


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     STUDENT BROWSER                          β”‚
β”‚              React (Vite) β€” PathSync AI Dashboard            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚ HTTPS / REST
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    FASTAPI BACKEND                           β”‚
β”‚                                                              β”‚
β”‚  Privacy Middleware β†’ PDF Parser β†’ Discovery Chat            β”‚
β”‚  Generation Service β†’ RAG Vector Search β†’ Cost Optimizer     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                          β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   ANTHROPIC API     β”‚  β”‚       SUPABASE (PostgreSQL)        β”‚
β”‚  claude-sonnet-4    β”‚  β”‚  scholarships  (vector 1536-dim)  β”‚
β”‚  claude-haiku-4-5   β”‚  β”‚  student_profiles (anonymous)     β”‚
β”‚  Prompt Caching     β”‚  β”‚  chat_sessions  (full history)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Layer Technology
AI Engine Anthropic Claude (Sonnet 4 + Haiku 4.5)
Backend FastAPI + Python 3.12
Database Supabase (PostgreSQL + pgvector)
PDF Parsing pdfplumber + PyMuPDF
NLP / Privacy spaCy (en_core_web_sm)
Frontend React 18 + Vite
Deployment Render.com + Docker

Project Structure

pathsync-ai/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”œβ”€β”€ chat.py               # Chat, transcript, match endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ generate.py           # CV, letter, deadline tracker
β”‚   β”‚   β”‚   β”œβ”€β”€ scholarships.py       # Scholarship ingestion
β”‚   β”‚   β”‚   β”œβ”€β”€ profile.py            # Student profile
β”‚   β”‚   β”‚   └── health.py
β”‚   β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”‚   β”œβ”€β”€ config.py             # Environment settings
β”‚   β”‚   β”‚   └── database.py           # asyncpg + pgvector
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   └── privacy.py            # PII redaction
β”‚   β”‚   └── services/
β”‚   β”‚       β”œβ”€β”€ chat_service.py       # Discovery interview + sessions
β”‚   β”‚       β”œβ”€β”€ pdf_parser.py         # Transcript parsing
β”‚   β”‚       β”œβ”€β”€ rag_service.py        # Vector search
β”‚   β”‚       β”œβ”€β”€ generation_service.py # CV + letter + tracker
β”‚   β”‚       └── cost_optimizer.py     # Model tiering + caching
β”‚   β”œβ”€β”€ schema.sql                    # Supabase schema + seed data
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── .env.example
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ index.html
β”‚   └── vite.config.js
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ render.yaml
└── README.md

Quick Start

Prerequisites

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/pathsync-ai.git
cd pathsync-ai

2. Configure environment

cp backend/.env.example backend/.env
# Fill in your keys in backend/.env
ANTHROPIC_API_KEY=sk-ant-...
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key
DATABASE_URL=postgresql://postgres:password@db.your-project.supabase.co:5432/postgres
OPENAI_API_KEY=        # optional β€” leave blank for local embeddings
REDIS_URL=redis://localhost:6379
DEBUG=false
ALLOWED_ORIGINS=["http://localhost:5173"]

3. Set up Supabase

Open Supabase β†’ SQL Editor β†’ paste the contents of backend/schema.sql β†’ Run.

4. Run locally (no Docker)

Terminal 1 β€” Backend:

cd backend

# Windows
python -m venv venv
.\venv\Scripts\Activate.ps1

# Mac/Linux
python -m venv venv
source venv/bin/activate

pip install -r requirements.txt
python -m spacy download en_core_web_sm
uvicorn app.main:app --reload --port 8000

Terminal 2 β€” Frontend:

cd frontend
npm install
npm run dev

Open http://localhost:5173 πŸš€

5. Run with Docker

docker compose up --build

API Reference

Method Endpoint Description
GET /api/v1/health Health check
POST /api/v1/chat/message Send a discovery interview message
POST /api/v1/chat/match Get top-K scholarship matches
POST /api/v1/chat/upload-transcript Upload + parse PDF transcript
DELETE /api/v1/chat/session/{id} Reset a session
GET /api/v1/profile/{session_id} Get anonymised student profile
POST /api/v1/generate/letter Generate application letter
POST /api/v1/generate/cv Generate scholarship CV
POST /api/v1/generate/tracker Generate deadline tracker
POST /api/v1/scholarships/ingest Add scholarship to knowledge base

Full interactive docs: http://localhost:8000/docs


Cost Optimisation

Model Tiering

Task Model Why
Chat turns claude-haiku-4-5 Fast + cheap (~$0.0002/conversation)
CV + letter generation claude-haiku-4-5 Sufficient for structured output
PDF transcript parsing claude-sonnet-4 Accuracy critical

Prompt Caching

System prompt cached using cache_control: ephemeral β€” saves ~90% on input tokens for returning users.


Scalability

  • Stateless FastAPI β€” run N replicas behind a load balancer
  • Supabase session storage β€” any replica serves any request
  • pgvector IVFFlat index β€” sub-10ms search at millions of vectors
  • 1,000+ concurrent users on a $25/month Render instance

Privacy & Security

  • Zero PII stored β€” all identifiers redacted before any LLM call
  • Anonymous sessions β€” no account required, no data breach risk
  • HTTPS enforced on all deployments

Deploy to Render

git push origin main
# Go to render.com β†’ New β†’ Blueprint β†’ connect repo
# Set env vars in Render dashboard β†’ Apply

Contributing

  1. Fork the repo
  2. Create your branch: git checkout -b feature/your-feature
  3. Commit: git commit -m 'Add your feature'
  4. Push: git push origin feature/your-feature
  5. Open a Pull Request

License

MIT β€” see LICENSE for details.


"It finds the scholarships. Writes the letter. Builds the CV. Tracks every deadline. It does everything except submit the application."

Built by ONI Goodness Oluwapelumi Β· Nigeria πŸ‡³πŸ‡¬

PathSync AI β€” Equity engine for Nigerian students

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages