Skip to content

mo-sameh1/AI-Research-Assistant

Repository files navigation

AI Scholarly Research Assistant

Backend service for researching scholarly articles from ArXiv with AI-powered summarization.

Features

  • 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

Quick Start

# 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 start

API

POST /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

Tech Stack

Node.js 18+ • TypeScript 5.3+ • Express • ArXiv API • Gemini/OpenAI/Anthropic

Configuration

Set in .env:

  • GEMINI_API_KEY (or OPENAI_API_KEY / ANTHROPIC_API_KEY) - Required
  • PORT - Default: 3000
  • MAX_SOURCES - Default: 10

ArXiv requires no API key.

Architecture

  • Factory Pattern: Auto-selects LLM provider based on available API keys
  • Strategy Pattern: Providers implement ILLMProvider interface
  • Layered Architecture: Routes → Controllers → Services → External APIs

License

MIT

About

TypeScript/Express backend for ArXiv research with query refinement, streaming summaries, and multi-provider LLM support.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages