Live Deployed link : https://cogni8cws.vercel.app/
Video Link : https://drive.google.com/file/d/1dUk7YRL_s8WFhrGKAbt_Ki-B2IGe2J1u/view?usp=sharing
Cogni is a full-stack learning system that helps students understand concepts deeply, track learning progress over time, and receive adaptive coaching across multiple cognitive modes.
- Project Overview
- Whatβs New
- Core Features
- Tech Stack
- Architecture
- Project Structure
- Setup
- Run the App
- API Surface
- Feature Usage Guide
- Troubleshooting
- Contributing
Cogni combines specialized AI engines with persistent learning memory to create a personalized study experience.
- Tracks how a student learns over time, not just one chat turn.
- Uses Hindsight memory to ground recommendations in prior behavior.
- Uses LLM reasoning to adapt explanations, questions, and roadmaps.
- Provides both conversational guidance and visual memory analytics.
Goal: Find when confusion patterns appeared and what helped previously.
- Endpoint:
GET /study/archaeology - Inputs: topic + confusion level
- Output: grounded recommendation + adaptive explanation context
Goal: Challenge misconceptions with targeted, adaptive questioning.
- Endpoints:
POST /socratic/ask,POST /socratic/reflect,POST /socratic/hint - Supports multi-turn questioning with response-aware follow-ups
- Includes compact metadata for question continuity
Goal: Predict likely next struggle areas from topic + patterns.
- Endpoint:
GET /insights/shadow - Returns prediction overview, evidence, and confidence signals
Goal: Discover hidden conceptual links between topics.
- Endpoint:
GET /insights/resonance - Hybrid approach: hardcoded fast paths + LLM-generated connections
Goal: Learn from personal + peer patterns with a full guided plan.
- Endpoint:
GET /insights/contagion - Pipeline: personal memory recall β style inference β strategy refinement β roadmap generation
- Returns:
- top strategy
- additional strategies
- learning plan (full roadmap text)
- memory grounding metadata
Goal: Make learning history visible and actionable.
- Endpoints:
GET /memory/recallGET /memory/timelineGET /memory/confidenceGET /memory/summaryGET /memory/what-cogni-knows
- Frontend uses timeline + confidence data for student performance visualization.
POST /memory/summaryfor text summariesPOST /memory/summary/pdffor downloadable study PDFs
- Quiz:
GET /study/quizPOST /study/quiz/submit
- Feedback & quality signals:
POST /feedback/logPOST /feedback/suggestGET /feedback/user-progressGET /feedback/insights
- Framework: Next.js 16.2.0
- UI: React 19 + TypeScript 5 + Tailwind CSS 4
- Components: Radix UI + custom UI system
- Charts: Recharts
- Framework: FastAPI
- Model layer: Pydantic
- AI: Groq LLM + Hindsight memory client
- Docs: OpenAPI/Swagger (
/docs) - PDF: ReportLab + FPDF2 fallback
Cogni follows a resilient hybrid pattern across engines:
- Use deterministic/hardcoded logic when reliable
- Enrich via hindsight memory retrieval
- Personalize with LLM generation
- Fall back safely if upstream generation is weak or unavailable
This keeps UX stable while preserving high-quality adaptive behavior.
Cogni/
βββ backend/
β βββ app/
β β βββ main.py
β β βββ engines/
β β β βββ archaeology_engine.py
β β β βββ socratic_engine.py
β β β βββ shadow_engine.py
β β β βββ resonance_engine.py
β β β βββ contagion_engine.py
β β βββ routes/
β β β βββ study_routes.py
β β β βββ socratic_routes.py
β β β βββ insights_routes.py
β β β βββ memory_routes.py
β β β βββ feedback_routes.py
β β β βββ health_routes.py
β β βββ services/
β β βββ models/
β βββ requirements.txt
β βββ run.py
βββ frontend/
β βββ src/
β β βββ app/page.tsx
β β βββ services/api.ts
β β βββ components/
β βββ package.json
βββ README.md
- Python 3.8+
- Node.js 18+
- npm (or yarn/pnpm)
- Groq API key
git clone <repository-url>
cd Cognicd backend
python -m venv .venvActivate environment:
- Windows PowerShell:
./.venv/Scripts/Activate.ps1 - macOS/Linux:
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txtCreate backend/.env:
GROQ_API_KEY=your_groq_api_key_herecd ../frontend
npm install
npm run devcd backend
python run.pyBackend URLs:
- API root:
http://localhost:8000 - Swagger:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc - Health:
http://localhost:8000/health
cd frontend
npm run devFrontend URL: http://localhost:3000
cd frontend
npm run build
npm run startAll routes are available under both direct paths and
/api/*aliases.
GET /health
POST /study/logGET /study/archaeologyGET /study/quizPOST /study/quiz/submit
POST /socratic/askPOST /socratic/reflectPOST /socratic/hintPOST /socratic/logGET /socratic/historyGET /socratic/killer-prompt-preview
GET /insights/shadowGET /insights/patternsGET /insights/resonanceGET /insights/contagion
GET /memory/recallGET /memory/timelineGET /memory/confidenceGET /memory/summaryGET /memory/what-cogni-knowsPOST /memory/summaryPOST /memory/summary/pdf
GET /feedback/insightsPOST /feedback/suggestGET /feedback/user-progressPOST /feedback/log
- Select Archaeology
- Set topic + confusion level
- Submit confusion statement
- Review past-pattern recommendation
- Select Socratic
- Enter belief/understanding
- Answer follow-up questions
- Use hints if stuck
- Select Shadow
- Set current topic
- Request prediction
- Review warning signals and micro-actions
- Select Resonance
- Enter topic
- Review concept links and why they matter
- Select Contagion
- Enter topic/error pattern
- Generate roadmap
- Follow the full personalized plan in order
- Open Memory or Graphs
- Refresh analytics
- Review confidence trends, timeline, and profile insights
- Ensure backend is running latest code and dependencies.
- Restart backend after updates to engine signatures.
- Verify endpoint in browser/Swagger:
GET /insights/contagion?error_pattern=recursion&user_id=student
- Check backend status in UI (online/offline indicator).
- Confirm response
statusissuccessin network tab. - Verify
learning_planexists indatapayload.
- Confirm
GROQ_API_KEYinbackend/.env. - Check backend logs for upstream errors/timeouts.
- Keep route contracts backward compatible.
- Add fallbacks when introducing LLM-dependent features.
- Validate both backend and frontend behavior after changes.
- Update docs when endpoints or payloads evolve.
Cogni is built to be both adaptive and reliable: memory-grounded where possible, LLM-augmented where useful, and safe-fallback by default.