Savant is a research assistant platform built during HackCU that helps users explore papers through three connected surfaces:
- A FastAPI backend for PDF ingestion, retrieval, graph generation, and session storage
- A Next.js frontend for document chat, voice interaction, citations, and graph exploration
- A Chrome side panel extension for generating concept trees from research pages
HackCU_12--main/
|- savant-backend/ FastAPI API, PDF ingestion, retrieval, graph endpoints
|- savant-frontend/ Next.js research cockpit UI
|- savant-extension/ Chrome side panel extension for paper context trees
|- .gitignore
- Upload PDF papers and chunk them page by page
- Store document chunks in MongoDB Atlas with vector search support
- Query papers with Gemini-backed answers plus lexical fallback
- Generate concept graphs and paper use cases from document context
- Save chat sessions and share them across users
- Optional Solana payment gating before query execution
- Voice input plus ElevenLabs or browser TTS playback
- Chrome extension support for ResearchGate, arXiv, and Semantic Scholar
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- Backend: FastAPI, Motor, PyPDF2, Gemini API, ElevenLabs
- Extension: Vite, React, TypeScript, Chrome Extensions Manifest V3
- Data: MongoDB Atlas vector search
- Node.js 20+
- npm
- Python 3.10+
- MongoDB Atlas database
- Gemini API key
- ElevenLabs API key for audio output
- Solana wallet and RPC endpoint if payment gating is enabled
Copy savant-backend/.env.example to savant-backend/.env and fill in the values.
Required backend variables:
MONGODB_URIGEMINI_API_KEYELEVENLABS_API_KEYELEVENLABS_VOICE_IDSOLANA_RPC_URLMASTER_WALLETQUERY_PRICE_SOLREQUIRE_SOLANA_PAYMENT
Copy savant-frontend/.env.example to savant-frontend/.env.local.
Required frontend variables:
NEXT_PUBLIC_API_BASE_URLNEXT_PUBLIC_SOLANA_RPC_URLNEXT_PUBLIC_MASTER_WALLETNEXT_PUBLIC_QUERY_PRICE_SOLNEXT_PUBLIC_REQUIRE_SOLANA_PAYMENT
The extension currently calls the backend at http://127.0.0.1:8000. Make sure the backend is running locally before testing the side panel.
Create a vector index on savant.documents named vector_index:
{
"fields": [
{
"numDimensions": 768,
"path": "embedding",
"similarity": "cosine",
"type": "vector"
}
]
}cd savant-backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --host 127.0.0.1 --port 8000 --reloadcd savant-frontend
npm install
npm run dev -- --hostname 127.0.0.1 --port 3000cd savant-extension
npm install
npm run buildThen open chrome://extensions, enable Developer Mode, choose Load unpacked, and select the generated savant-extension/dist folder.
- Start the backend
- Start the frontend
- Build and load the Chrome extension
- Upload a PDF in the web app or open a supported paper page for the extension
- Root documentation added
- Frontend environment template added
- Frontend and extension documentation added
- Existing
.gitignorealready covers common Python, Node, build, and secret files
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin <your-github-repo-url>
git push -u origin mainIf this folder is already inside another Git repository, create the GitHub remote from that existing repo root instead of running git init again.
savant-frontend/README.mdnow contains app-specific frontend setup detailssavant-extension/README.mddocuments how to build and load the browser extension- No license file was added because license choice is a product decision and should match how you want others to use the code