Backend service for researching scholarly articles from ArXiv with AI-powered summarization.
- Smart Query Refinement: LLM extracts research intent from natural language
- ArXiv Integration: Direct access to 2M+ scholarly articles (no API key required)
- Multi-Provider LLM: Supports Gemini, OpenAI, or Anthropic
- Streaming Support: Real-time summary generation
- Type-Safe: Full TypeScript with strict mode
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Add your GEMINI_API_KEY to .env
# Run in development
npm run dev
# Build for production
npm run build
npm startPOST /api/research - Research scholarly articles
curl -X POST http://localhost:3000/api/research \
-H "Content-Type: application/json" \
-d '{"query": "quantum mechanics", "maxSources": 5}'POST /api/research/stream - Streaming response with SSE
GET /api/health - Health check
Node.js 18+ • TypeScript 5.3+ • Express • ArXiv API • Gemini/OpenAI/Anthropic
Set in .env:
GEMINI_API_KEY(orOPENAI_API_KEY/ANTHROPIC_API_KEY) - RequiredPORT- Default: 3000MAX_SOURCES- Default: 10
ArXiv requires no API key.
- Factory Pattern: Auto-selects LLM provider based on available API keys
- Strategy Pattern: Providers implement
ILLMProviderinterface - Layered Architecture: Routes → Controllers → Services → External APIs
MIT