AI-Powered Academic Intelligence Platform with Adaptive Hybrid + Agentic RAG
Acadence AI is a multi-tenant AI-powered academic automation platform designed for large-scale educational datasets. It combines adaptive Hybrid RAG, intelligent agents, SQL-grounded reasoning, semantic retrieval, and automation workflows to deliver accurate, grounded, and conversational insights over academic records in real time.
The platform keeps each tenant's data, logs, and agent activity isolated so multiple institutions can use the same deployment without seeing each other's records.
Built for real-world educational institutions, the platform enables teachers, students, parents, and administrators to query complex academic datasets naturally while minimizing hallucinations through database-verified responses and grounded retrieval pipelines.
- Adaptive LLM-driven query planning
- Hybrid SQL + semantic retrieval orchestration
- Multi-step reasoning workflows
- Context reranking and validation
- Conversational multi-turn memory
- Hallucination prevention pipeline
- Database-grounded response generation
- Rule-based routing and intent handling as a fallback reliability layer
- Safe fallback execution for low-confidence or ambiguous queries
Supports natural language questions such as:
- "Who are the top 10 students?"
- "Compare semester 4 toppers with semester 5 performance"
- "Which students are underperforming in DSA?"
- "Summarize class performance trends"
- "Which students improved the most?"
The system dynamically determines whether the query requires:
- SQL retrieval
- semantic retrieval (FAISS or
pgvector) - hybrid retrieval
- analytics reasoning
- multi-step orchestration
- Handles massive academic datasets
- Multi-column student result processing
- CSV, Excel, and PDF ingestion
- Schema normalization and validation
- Duplicate detection and cleaning
- LLM dynamically generates SQL queries
- PostgreSQL acts as the source of truth
- Rankings, analytics, filtering, and aggregations are database verified
- Prevents fabricated academic values
- Vector retrieval (FAISS or
pgvector) - Context-aware semantic search
- Similarity-based chunk retrieval
- Reranking for high-confidence context selection
- Query planning agents
- Retrieval orchestration agents
- Analytics reasoning workflows
- Email automation agents
- Multi-step reasoning pipelines
- Automated academic workflow processing
- Gmail attachment ingestion
- Automated report generation
- Notification workflows
User Query
β
LLM Query Planner
β
Dynamic Tool Selection
IF structured:
β SQL generation
β PostgreSQL execution
β verified structured data
IF semantic:
β FAISS or `pgvector` retrieval
β reranker
β grounded context
IF hybrid:
β SQL + semantic retrieval
β context fusion
β reranking
β grounded LLM response
| Layer | Technology |
|---|---|
| Frontend | React, Vite, Tailwind CSS |
| Backend | FastAPI, Python |
| Database | PostgreSQL |
| Semantic Retrieval | Postgres (pgvector) [default] / FAISS (optional) |
| AI Layer | Gemini / LLM |
| Parsing | LlamaParse, Pandas |
| Automation | Gmail Automation |
| Cloud | GCP, Cloud Storage |
| Vector Embeddings | Sentence Transformers |
| Orchestration | Agentic RAG Workflows |
- Python 3.9+ (3.11 recommended)
- Node.js 18+ and npm/yarn
- PostgreSQL 12+ running and reachable via
DATABASE_URL - (Optional) Elasticsearch and Redis for advanced features
git clone https://github.com/3015pavan/Acadence-Ai.git
cd Acadence-AiCreate a .env file in the repository root and set the required variables:
DATABASE_URL=postgresql://user:password@localhost:5432/acadence_ai_db
AUTH_SECRET=change-me-in-production
BOOTSTRAP_ADMIN_EMAIL=admin@example.com
BOOTSTRAP_ADMIN_PASSWORD=change-me
GCP_GEMINI_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.5-flash
GEMINI_THINKING_LEVEL=low
GMAIL_SERVICE_ACCOUNT_JSON=path/to/credentials.json
ELASTICSEARCH_URL=http://localhost:9200
ACCESS_TOKEN_TTL_SECONDS=1800
REFRESH_TOKEN_TTL_SECONDS=1209600# Backend
python -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
# Frontend
cd frontend
npm installcd ..
alembic upgrade headBackend
cd backend
python -m uvicorn main:app --reload --host 127.0.0.1 --port 8000Frontend
cd frontend
npm run devEmail Agent (Optional)
python backend/agents/email_agent.py- Health:
GET /healthathttp://127.0.0.1:8000/health - Docs:
http://127.0.0.1:8000/docs - Frontend:
http://127.0.0.1:5173
Perfect for testing, ad-hoc analysis, and interactive exploration.
- Navigate to
http://127.0.0.1:5173 - Go to Upload Page and drop an Excel or PDF file
- View Dashboard with instant analytics
- Use Query Chat for natural language questions
Perfect for institutions with regular result batches.
- Setup Gmail Integration (see Email Automation Setup)
- Start the email agent:
python backend/agents/email_agent.py - Send result files to the monitored Gmail address
- Agent automatically:
- β Detects emails with attachments
- β
Processes
.xlsxand.pdffiles - β Generates PDF analysis reports
- β Replies with insights and download links
POST /analytics/query
Content-Type: application/json
{
"query": "Who are the top 5 performers?",
"file_ids": [], # Empty = all datasets
"history": [] # Chat history (optional)
}Response:
{
"intent": "CONTEXTUAL_ANSWER",
"answer": "The top performers are...",
"students": [
{"name": "Student A", "sgpa": 9.2},
{"name": "Student B", "sgpa": 9.0}
],
"meta": {
"confidence": 0.95,
"citations": ["Student A: SGPA 9.2", "Student B: SGPA 9.0"]
}
}# List all datasets
GET /analytics/datasets
# Upload file
POST /upload/file
Content-Type: multipart/form-data
# Delete dataset (cleanup)
DELETE /analytics/datasets/{dataset_id}
# Rebuild search index
POST /analytics/reindex| Your Question | Intent Type | Result |
|---|---|---|
Who are the toppers? |
SQL_QUERY | Database-verified list with SGPA |
Students with A+ but failed |
HYBRID | SQL + semantic analysis |
Average SGPA in DSA subject |
SQL_AGGREGATION | Database computed statistic |
Result of Abir in DSA |
SQL_LOOKUP | Database-verified record |
Pass rate by semester |
SQL_ANALYTICS | Cross-tabulated summary |
Summarize this class |
SEMANTIC + ANALYTICS | LLM narrative with DB-grounded insights |
Who needs support? |
HYBRID | At-risk identification with reasoning |
# Database Connection
DATABASE_URL=postgresql://user:password@localhost:5432/acadence_ai_db
# LLM Configuration (Google Gemini)
GCP_GEMINI_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.5-flash
GEMINI_THINKING_LEVEL=low
# Gmail Integration (Optional)
GMAIL_SERVICE_ACCOUNT_JSON=path/to/credentials.json
GMAIL_INBOX_CHECK_INTERVAL=300 # seconds
# Multi-tenant configuration
# An example tenant-aware variable: when running a single-instance multi-tenant deployment,
# tenants are represented in the database. Per-tenant storage paths and tokens are namespaced
# by `owner_user_id` or `tenant_id` (e.g. `backend/storage/gmail_tokens/tenant_<id>.json`).
# No global token files are used in production; ensure your deployment scripts create
# per-tenant directories with correct permissions.
# Search Backends (Optional)
ELASTICSEARCH_URL=http://localhost:9200
REDIS_URL=redis://localhost:6379
# API Configuration
API_PORT=8000
FRONTEND_URL=http://127.0.0.1:5173Automate your entire student results processing pipeline β From inbox to insights in minutes.
- Go to Google Cloud Console
- Create a new project (or use existing)
- Create a new service account
- Download private key as JSON (
credentials.json) - Place in project root
- In Google Cloud Console, search for "Gmail API"
- Click Enable
- Go to Service Account details
- Grant access to your Gmail address
GMAIL_SERVICE_ACCOUNT_JSON=./credentials.json
GMAIL_INBOX_CHECK_INTERVAL=300python backend/agents/email_agent.pyNote: the email agent uses per-tenant token files and per-tenant job ids (e.g. email-agent-poll-<tenant_id>).
If running multiple tenants on one host, ensure the agent is started in a way that isolates
per-tenant tokens and storage directories (or run separate agent processes per tenant).
π§ Incoming Email
β
π Detect Attachment (.xlsx, .pdf)
β
βοΈ Parse & Validate Data
β
π Generate PDF Report
β
πΎ Store Results & Index
β
βοΈ Auto-Reply with Link
- FAISS / pgvector Indexing: ~1M vectors, <100ms search latency (depends on storage and infra)
- Elasticsearch: Full-text search over 100K+ documents
- PostgreSQL: Sub-50ms indexed queries on 10K+ records
- LLM Response Time: ~2-5s (including context retrieval)
- Cache Hit Rate: 70%+ for repeated queries with Redis
- Concurrent Users: Tested with 50+ concurrent connections
The platform includes production-grade evaluation and monitoring pipelines for:
- Hallucination Rate
- Query Accuracy
- Recall@K
- Precision@K
- Groundedness Score
- Faithfulness Score
- SQL Execution Accuracy
- Retrieval Precision
- Multi-turn Context Accuracy
- Workflow Success Rate
- End-to-End Latency
# Start backend first, then:
python tools/smoke_test_query.py "Summarize this class"python TEST_QUERIES_VALIDATION.pypip install -r requirements.txt
pytest -vpython tools/evaluate.py- Analyze student performance
- Identify weak students
- Compare semester trends
- Generate reports automatically
- Query marks and analytics
- Understand performance trends
- Track academic progress
- Monitor student performance
- View attendance and results
- Understand strengths and weaknesses
- Automate result processing
- Generate analytics dashboards
- Enable AI-driven academic intelligence
- π Project Structure: See
backend/andfrontend/directories - π API Endpoints: Full docs in
backend/routes/ - βοΈ Query Engine: Core logic in
backend/services/query_engine.py - π€ LLM Integration: See
backend/services/intelligence.py - π§ Email Agent: Details in
backend/agents/email_agent.py
- Multimodal RAG support
- Predictive analytics
- Real-time streaming ingestion
- Advanced analytics agents
- Personalized academic recommendations
- Distributed vector search
- Role-aware reasoning pipelines
- Multi-language support
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request with description
git clone https://github.com/3015pavan/Acadence_Ai.git
cd agent_edata
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt"LLM Provider not responding"
# Check your API key
echo $GCP_GEMINI_KEY # Should show your Gemini API key
# Test the connection
python -c "from backend.services.intelligence import _llm_chat_json""Database connection failed"
# Verify PostgreSQL is running
psql -U user -d acadence_ai_db -c "SELECT 1"
# Check DATABASE_URL in .env is correct"No results found for query"
# Ensure files are uploaded
curl http://127.0.0.1:8000/analytics/datasets
# Check dashboard for parse errors- π Check Documentation
- π Open an Issue
- π¬ Start a Discussion
Unlike traditional rule-based academic chatbots, Acadence AI uses adaptive Hybrid + Agentic RAG to dynamically reason over structured and semantic academic data. The system is designed to answer arbitrary natural language questions over large academic datasets while maintaining grounded, verifiable, and reliable responses.
- Low hallucination rate
- High retrieval precision
- SQL-grounded correctness
- Adaptive query handling
- Production-grade scalability
- Real-time conversational analytics
Pavan Reddy
Building production-grade AI systems focused on adaptive RAG architectures, intelligent agents, semantic retrieval, automation workflows, and grounded AI reasoning over large-scale datasets.
Acadence AI β AI-Powered Academic Intelligence Platform
Have questions? Open an Issue | Start a Discussion | Email Us
β If Acadence AI helps you, please star us on GitHub! β Star