π 2nd Place Overall Winner at HackGT 12 π
Team Members:
- Nikhilesh
- Dhruva
- Shreyas
- Krishna
RefNet is a comprehensive tool for searching research papers and visualizing their citation networks. It combines a powerful search interface with an interactive graph visualization and AI-powered analysis to help researchers explore academic literature and understand citation relationships.
- Custom Mastra Backend: Express.js + OpenAI GPT-4o for intelligent research analysis
- Smart Context: AI understands your selected papers and graph relationships
- Research Insights: Compare papers, identify patterns, and discover research gaps
- Real-time Analysis: Ask questions about your selected papers and get instant insights
- Review Paper Generation: AI-powered literature review creation with PDF export
- Search research papers by title, authors, topics, and keywords
- Filter results by publication date, citation count, and relevance
- Sort by most cited, relevance score, or publication date
- Paginated results with customizable page sizes
- Multiselect functionality - Select multiple papers to build combined citation networks
- Build citation networks from any research paper or multiple papers
- Interactive D3.js-powered graph with zoom, pan, and drag functionality
- Node selection and highlighting
- Timeline-based color coding
- Light grey/white lines for clean, academic appearance
- Export selected papers and graph data
- Graph Rebuild Fallback: Automatic restoration of previous graph on rebuild failure
- Generate comprehensive literature reviews from selected papers
- AI-generated sections: Abstract, Introduction, Fundamentals, Types & Categories, State-of-the-Art
- Intelligent title generation based on paper analysis
- PDF export with academic formatting
- Text file fallback for compatibility
- Responsive design that works on desktop and mobile
- Fast, modern React frontend
- Real-time API integration
- Intuitive user experience
- PWA Support: Manifest.json for progressive web app capabilities
- Python 3.8+ (for search API)
- Node.js 18+ (for Mastra AI backend)
- npm or yarn
- OpenAI API key
-
Set your OpenAI API key:
export OPENAI_API_KEY='your-openai-api-key-here'
-
Start all services:
./start_cedar_mastra.sh
This will start:
- Flask search API on
http://localhost:8000 - Mastra AI backend on
http://localhost:4111 - React frontend on
http://localhost:3000
- Flask search API on
If you prefer to start services manually:
-
Start Flask search API:
python app.py
-
Start Mastra AI backend:
cd mastra-backend npm start -
Start React frontend:
cd refnet/frontend npm start
# Set your OpenAI API key
export OPENAI_API_KEY='your-openai-api-key-here'
# Start with Docker Compose
docker-compose upTo build the frontend for production:
cd refnet/frontend
npm run buildThe built files will be in refnet/frontend/build/ and will be automatically served by the Flask backend.
-
Search Papers: Use the landing page to search for research papers by entering keywords, author names, or topics.
-
Select Papers:
- Use checkboxes to select multiple papers from search results
- Click "Build Graph" to create a combined citation network from all selected papers
- Or click "View Graph" on individual papers for single-paper networks
-
Explore Network:
- Click and drag nodes to rearrange the graph
- Click nodes to select/deselect them
- Use the controls to adjust graph parameters (iterations, limits)
- Export selected papers as JSON
-
AI Analysis:
- Click the chat button to open the AI research assistant
- Ask questions about your selected papers
- Get intelligent insights, comparisons, and research recommendations
- The AI understands your paper context and graph relationships
-
Generate Review Papers:
- Select papers from your graph
- Click "Generate Survey Paper" to create AI-powered literature review
- Export as PDF or text file
-
Navigate: Use the back button to return to search results or start a new search.
GET /api/search?q=query&page=1&per_page=25&sort=cited_by_count- Search papers
GET /api/paper/{paper_id}- Get paper detailsGET /api/paper/{paper_id}/citations- Get paper citationsGET /api/paper/{paper_id}/references- Get paper references
GET /api/graph/{paper_id}?iterations=3&cited_limit=5&ref_limit=5- Build citation graph from single paperPOST /api/graph/multiple- Build graph from multiple papers (multiselect)GET /api/graph/data- Get current graph dataPOST /api/graph/clear- Clear current graph
POST /chat- AI chat and research analysisGET /health- Health check
RefNet/
βββ app.py # Flask search API entry point
βββ config.py # Configuration settings
βββ requirements.txt # Python dependencies
βββ mastra-backend/ # Mastra AI backend (Node.js + Express)
β βββ server.js # AI agent server
β βββ package.json # Backend dependencies
β βββ README.md # Backend documentation
βββ refnet/
β βββ api/ # API route blueprints
β β βββ chat_routes.py # Chat API routes
β β βββ graph_routes.py # Graph API routes
β β βββ paper_routes.py # Paper API routes
β β βββ search_routes.py # Search API routes
β βββ models/ # Data models
β β βββ graph.py # Graph data models
β β βββ paper.py # Paper data models
β βββ services/ # Business logic services
β β βββ graph_service.py # Graph processing
β β βββ openalex_service.py # OpenAlex API integration
β βββ utils/ # Utility functions
β β βββ rate_limiter.py # API rate limiting
β β βββ validators.py # Data validation
β βββ tests/ # Test files
β βββ frontend/ # React frontend
β βββ src/
β β βββ components/
β β β βββ GraphViewerClean.js # Main graph visualization
β β β βββ FloatingCedarChat.js # AI chat interface
β β β βββ LandingPage.js # Search interface
β β β βββ ChatTracker.js # Chat management
β β βββ services/
β β β βββ api.js # API client
β β β βββ cedarAgent.js # AI agent service
β β βββ cedar/ # Cedar OS configuration
β β βββ ...
β βββ public/
β β βββ index.html
β β βββ favicon.ico
β β βββ logo.svg
β β βββ logo192.png
β β βββ manifest.json # PWA manifest
β βββ package.json
βββ docker-compose.yml # Docker Compose configuration
βββ Dockerfile.flask # Flask API Docker image
βββ Dockerfile.mastra # Mastra AI Docker image
βββ start_cedar_mastra.sh # Development startup script
βββ README.md
- Flask: Search API framework
- Express.js: Mastra AI backend framework
- OpenAI GPT-4o: Research analysis AI
- OpenAlex API: Research paper data source
- NetworkX: Graph analysis and processing
- Flask-CORS: Cross-origin resource sharing
- React 18: UI framework
- React Router: Client-side routing
- D3.js: Graph visualization
- Axios: HTTP client
- Tailwind CSS: Styling
- PWA: Progressive Web App capabilities
- Docker: Containerization
- AWS EC2: Cloud hosting
- Docker Compose: Multi-service orchestration
- Production URLs:
- Frontend:
https://refnet.wiki - API:
https://api.refnet.wiki - Mastra AI:
https://api.refnet.wiki/mastra
- Frontend:
The system generates comprehensive literature reviews using AI-powered content creation:
- Paper Selection: Users select papers from the citation graph
- AI Analysis: Each paper gets an AI-generated summary via GPT-4o
- Content Generation: Creates 5 sections (Abstract, Introduction, Fundamentals, Types & Categories, State-of-the-Art)
- PDF Export: Uses browser print functionality for professional PDF output
- Fallback: Text file export if PDF generation fails
Tech Stack for Review Generation:
- AI Backend: Mastra (Express.js + OpenAI GPT-4o)
- PDF Generation: Browser native print functionality
- Content Processing: Custom algorithms for domain detection and title generation
- Formatting: HTML-to-PDF with academic styling
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.