Skip to content

e-man07/ResearchOS

Repository files navigation

ResearchOS

An autonomous research copilot powered by AI agents and MCP connectors

Overview

ResearchOS is a production-ready autonomous research copilot that transforms weeks of manual research into minutes of intelligent automation. It leverages:

  • ADK-TS for multi-agent orchestration (5 specialized agents)
  • Model Context Protocol (MCP) for modular data connectors
  • Weaviate for vector database and RAG-powered chat
  • Multiple scientific APIs (arXiv, Semantic Scholar)
  • Gemini Fallback for resilient LLM operations

Features

Currently Implemented

  • Unified Multi-Source Search - Search arXiv and Semantic Scholar simultaneously
  • Multi-Agent Workflows - 5 specialized agents (Planner, Search, Synthesis, Report Writer, Q&A)
  • RAG-Powered Chat - Conversational interface for exploring indexed papers
  • Automated Literature Reviews - Generate comprehensive reports in minutes
  • Authentication - Google OAuth via NextAuth.js
  • Workflow Management - Real-time progress tracking and history
  • Paper Indexing - Automatic chunking and vector embedding
  • Gemini Fallback - Automatic fallback when OpenAI rate limits are hit
  • Dashboard - View workflows, papers, and chat sessions

Quick Start

Prerequisites

  • Node.js 20+ LTS
  • npm or pnpm
  • PostgreSQL database (or use Neon, Supabase, etc.)
  • Weaviate Cloud account (or self-hosted)
  • OpenAI API key
  • Google API key (optional, for Gemini fallback)

Installation

# Clone the repository
git clone https://github.com/e-man07/ResearchOS.git
cd research-os

# Install dependencies
npm install

# Set up environment variables
# Copy .env.example to apps/web/.env and apps/agent-server/.env
# Edit with your API keys and database URLs

Environment Variables

apps/web/.env:

# Database
DATABASE_URL="postgresql://..."

# Weaviate
WEAVIATE_URL="https://your-instance.weaviate.cloud"
WEAVIATE_API_KEY="your-api-key"

# OpenAI
OPENAI_API_KEY="sk-..."

# Gemini (optional, for fallback)
GOOGLE_API_KEY="..."
FALLBACK_LLM_MODEL="gemini-2.0-flash-exp"
ENABLE_LLM_FALLBACK=true

# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret"

# Agent Server
AGENT_SERVER_URL="http://localhost:3002"

apps/agent-server/.env:

# OpenAI
OPENAI_API_KEY="sk-..."

# Gemini (optional)
GOOGLE_API_KEY="..."
FALLBACK_LLM_MODEL="gemini-2.0-flash-exp"

# Server
AGENT_SERVER_PORT=3002
NODE_ENV=development

Running the Application

# Option 1: Use the convenience script
./start-all.sh

# Option 2: Run manually in separate terminals

# Terminal 1: Agent Server
cd apps/agent-server
npm run dev

# Terminal 2: Web Application
cd apps/web
npm run dev

# Terminal 3: Database migrations (first time only)
cd apps/web
npx prisma migrate dev

Access Points

Project Structure

research-os/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/                 # Core utilities and types
β”‚   β”œβ”€β”€ mcp-connectors/       # MCP server implementations (arXiv, Semantic Scholar)
β”‚   β”œβ”€β”€ agents/               # ADK-TS agent implementations (5 agents)
β”‚   β”œβ”€β”€ ingestion/            # Data ingestion pipeline (chunking, embedding)
β”‚   └── rag/                  # RAG implementation (Weaviate, embeddings)
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                  # Next.js web application (UI + API routes)
β”‚   β”‚   β”œβ”€β”€ src/app/         # Next.js App Router
β”‚   β”‚   β”‚   β”œβ”€β”€ api/v1/      # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ workflows/   # Workflow UI
β”‚   β”‚   β”‚   β”œβ”€β”€ chat/        # Chat interface
β”‚   β”‚   β”‚   └── rag/         # RAG Q&A interface
β”‚   β”‚   └── prisma/          # Database schema
β”‚   └── agent-server/         # Standalone Express server for ADK-TS agents
β”‚       β”œβ”€β”€ src/routes/      # API routes (workflows, agents)
β”‚       └── dist/            # Compiled TypeScript
└── docs/                     # Documentation

Architecture

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Next.js Web Application            β”‚
β”‚  - User Interface (React)               β”‚
β”‚  - API Routes (Proxy to Agent Server)   β”‚
β”‚  - Authentication (NextAuth.js)          β”‚
β”‚  - Database (Prisma + PostgreSQL)       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ HTTP
                   ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Agent Server (Express)              β”‚
β”‚  - ADK-TS Agent Orchestration            β”‚
β”‚  - Multi-Agent Workflows                 β”‚
β”‚  - MCP Tool Integration                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      ADK-TS Agents (5 Agents)           β”‚
β”‚  - Planner Agent                         β”‚
β”‚  - Search Agent (with MCP tools)        β”‚
β”‚  - Synthesis Agent                       β”‚
β”‚  - Report Writer Agent                   β”‚
β”‚  - Q&A Agent (RAG-powered)              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      MCP Connectors                      β”‚
β”‚  - arXiv MCP Server                     β”‚
β”‚  - Semantic Scholar MCP Server          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      RAG Pipeline                        β”‚
β”‚  - Text Chunking                         β”‚
β”‚  - Vector Embeddings (OpenAI)           β”‚
β”‚  - Semantic Search (Weaviate)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
                   ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      Storage Layer                       β”‚
β”‚  - Weaviate (Vector DB)                  β”‚
β”‚  - PostgreSQL (Metadata)                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Agent Workflow

The system uses 5 specialized AI agents working together:

  1. Planner Agent - Analyzes queries and creates research strategies
  2. Search Agent - Retrieves papers using MCP connectors (arXiv, Semantic Scholar)
  3. Synthesis Agent - Analyzes papers and identifies patterns
  4. Report Writer Agent - Generates comprehensive literature reviews
  5. Q&A Agent - Answers questions about indexed papers using RAG

See PLATFORM_OVERVIEW.md for detailed agent descriptions.

Development

Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests for specific package
pnpm --filter @research-os/core test

Linting

# Lint all packages
pnpm lint

# Fix linting issues
pnpm lint:fix

# Type check
pnpm typecheck

Building

# Build all packages
pnpm build

# Build specific package
pnpm --filter @research-os/core build

Documentation

Core Documentation

Phase Documentation

Technical Documentation

Technology Stack

Core Technologies

  • Language: TypeScript 5.3+
  • Runtime: Node.js 20 LTS
  • Package Manager: npm workspaces
  • Frontend: Next.js 14 (App Router), React 18, TailwindCSS
  • Backend: Next.js API Routes, Express.js (Agent Server)

AI & Agents

  • Agent Framework: ADK-TS (@iqai/adk v0.5.0)
  • LLM: OpenAI GPT-4o (with Gemini fallback)
  • Embeddings: OpenAI text-embedding-3-small
  • MCP SDK: @modelcontextprotocol/sdk

Data & Storage

  • Vector DB: Weaviate Cloud
  • Database: PostgreSQL (via Prisma ORM)
  • Authentication: NextAuth.js

Development Tools

  • Testing: Vitest, Jest
  • Linting: ESLint + Prettier
  • Type Checking: TypeScript strict mode

About

Your Autonomous Research Copilot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages