π€ AI-GENERATED PROJECT
This project was created through a single-shot AI agent benchmark run using GitHub Copilot with Claude Sonnet 4.5 on the prompt defined in prompt.md
Original benchmark: agent-comparison/copilot_sonnet-45The initial result was near production-ready, so this repository serves as a standalone project for final refinements and ongoing development.
In.report/you may find the original chat history to this run and so on.
A research paper catalog with continuous autonomous ingestion, GraphRAG-based search, and multiple specialized views with the stand out feature of finding papers providing pro- and contra-arguments to a given theory input. Built with FastAPI backend and React frontend.
- Paper Ingestion: Manual arXiv link input and continuous autonomous monitoring
- GraphRAG: Knowledge graph showing paper relationships (authors, citations, topics)
- Semantic Search: Vector similarity-based paper discovery
- Theory Mode: RAG-based argument discovery for hypothesis validation
- Four Specialized Views:
- Dashboard: Statistics, charts, continuous import management
- Paper List: Filterable/sortable catalog with status management
- Paper Detail: Comprehensive metadata, AI summaries, relationships, notes
- Theory Mode: Pro/contra argument analysis for hypothesis validation
- Real-time Updates: WebSocket-based progress tracking
- Resilient Architecture: Graceful degradation when LLM/embeddings unavailable
The easiest way to get started:
bash run.shThis automated script will:
- Install all frontend dependencies (
npm install) - Build the production frontend (
npm run build) - Install all backend dependencies (
uv sync) - Start the backend server on port 8000
- Serve the built frontend automatically
After running, access the application at http://localhost:8000
If you prefer to set up components separately:
Install Dependencies:
# Backend dependencies
uv sync
# Frontend dependencies
cd frontend
npm install
cd ..Configure Environment:
# Copy template and edit with your credentials
cp .envtemplate .envRequired environment variables:
DEFAULT_MODEL: LLM model (e.g.,azure/gpt-4.1oropenai/gpt-4)DEFAULT_EMBEDDING_MODEL: Embedding model (e.g.,azure/text-embedding-3-small)- Plus corresponding API keys (see
.envtemplate)
Run the Application:
Option A: Run both backend and frontend together
# Terminal 1: Start backend
uv run uvicorn researcher.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2: Start frontend
cd frontend && npm run devOption B: Build and run production
# Build frontend
cd frontend && npm run build && cd ..
# Run backend (serves frontend automatically)
uv run uvicorn researcher.main:app --host 0.0.0.0 --port 8000Access the Application:
- Development: http://localhost:3000 (frontend dev server)
- Production: http://localhost:8000 (backend serves built frontend)
- API Docs: http://localhost:8000/docs
- Navigate to Papers view
- Enter arXiv URL or ID (e.g.,
2103.12345orhttps://arxiv.org/abs/2103.12345) - Click "Add Paper" - watch real-time progress
- Paper is automatically:
- Downloaded and text extracted
- Embedded for semantic search
- Analyzed by LLM (if available)
- Added to knowledge graph
- Go to Dashboard
- Create a new import task:
- Name it (e.g., "CS.AI Papers")
- Optional: Filter by arXiv category (e.g.,
cs.AI) - Click "Create Task"
- Task runs every 5 minutes, importing new matching papers
- Monitor progress and imported count in dashboard
- Use the search bar in Papers view
- Enter natural language query (e.g., "transformers for image processing")
- Results ranked by semantic similarity
- Navigate to Theory Mode
- Enter your hypothesis (e.g., "Attention mechanisms improve model interpretability")
- Click "Analyze Hypothesis"
- View pro/contra arguments with:
- Relevance scores
- AI-generated summaries
- Key quotes from papers
- Export analysis as text file
Click any paper to view:
- Full metadata and abstract
- AI-generated summary and key contributions
- Similar papers (by embeddings)
- Related papers (by graph relationships)
- Personal notes
- Export options (BibTeX, PDF link)
PaperTrail is designed to work even when services are unavailable:
- Primary: litellm with configured embedding model
- Fallback: sentence-transformers (automatic, always works)
- Papers can always be ingested and searched
- When Available: Full AI summaries, analysis, theory mode
- When Unavailable:
- Papers stored with
<summary>placeholders - Added to backfill queue
- Automatically processed when LLM becomes available
- Theory mode disabled with clear message
- Papers stored with
- Monitors backfill queue continuously
- Processes papers with placeholders when LLM becomes available
- No manual intervention needed
βββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend (Vite) β
β Dashboard β Papers β Detail β Theory β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β REST API + WebSocket
ββββββββββββββββββββ΄βββββββββββββββββββββββββββ
β FastAPI Backend (Python) β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β Services Layer β β
β β β’ Ingestion β’ Search β’ Graph β β
β β β’ LLM β’ Embeddings β’ Backfill β β
β ββββββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββ β
β β Data Layer (TinyDB) β β
β β β’ Papers β’ Embeddings β’ Graph β β
β β β’ Tasks β’ Backfill Queue β β
β ββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ
Tech Stack:
- Backend: FastAPI, litellm, sentence-transformers, TinyDB, NetworkX
- Frontend: React, Vite, Recharts, Axios
- Data Sources: arXiv API, PyPDF2 for text extraction
- Real-time: WebSocket for progress updates
# Run core functionality tests
uv run pytest tests/test_core.py -v
# Test with LLM disabled (validates fallback)
# Remove DEFAULT_MODEL from .env temporarily
uv run pytest tests/test_core.py -vresearcher/
βββ src/researcher/
β βββ main.py # FastAPI application
β βββ models.py # Pydantic models
β βββ config.py # Configuration
β βββ database.py # TinyDB wrapper
β βββ embeddings.py # Embedding service (with fallback)
β βββ llm.py # LLM service (with graceful degradation)
β βββ ingestion.py # arXiv ingestion
β βββ search.py # Search and theory mode
β βββ graph.py # GraphRAG service
β βββ continuous_import.py # Background import tasks
β βββ backfill.py # Background backfill worker
β βββ logger.py # Logging setup
βββ frontend/
β βββ src/
β β βββ main.jsx # React entry point
β β βββ App.jsx # Main app component
β β βββ api.js # API client
β β βββ websocket.js # WebSocket hook
β β βββ views/ # View components
β β βββ DashboardView.jsx
β β βββ PaperListView.jsx
β β βββ PaperDetailView.jsx
β β βββ TheoryModeView.jsx
β βββ package.json
β βββ vite.config.js
βββ tests/
β βββ test_core.py # Core functionality tests
βββ data/ # Created at runtime (TinyDB storage)
βββ pyproject.toml
βββ README.md
Both backend and frontend include extensive logging:
Backend (Terminal):
- Service initialization and availability
- Paper ingestion progress
- Search operations and results
- Fallback activations
- Background worker activities
- All errors with stack traces
Frontend (Browser Console):
- Component lifecycle
- API calls and responses
- WebSocket messages
- User actions
- State changes
- Service availability status
Check browser DevTools console and terminal output for detailed operation logs.
- Check
.envhas correctDEFAULT_MODELand API keys - Papers will still be ingested with placeholders
- Backfill worker will process them when LLM becomes available
- Should automatically fall back to sentence-transformers
- Check terminal logs for "Fallback embedding model loaded"
- All functionality still works, just uses different embedding model
- Check terminal for ingestion errors
- Verify arXiv ID is valid
- Check WebSocket connection status in UI
- Ensure task is active (green status)
- Check task interval and filters
- Monitor backend logs for import activity
# Run backend with auto-reload
uv run uvicorn researcher.main:app --reload
# Run frontend with hot-reload
cd frontend && npm run dev
# Build frontend for production
cd frontend && npm run buildMIT
