An open-source, production-grade autonomous research platform inspired by Perplexity Pro & OpenAI Deep Research.
Combines autonomous planning, live web scraping, vector memory synthesis, contradiction verification, and real-time SSE streaming into publication-ready intelligence reports.
Key Features β’ Architecture β’ Quick Start β’ Configuration β’ API Reference β’ Security
- π― Perplexity-Inspired Dark UI: Clean, distraction-free interface built with Next.js 14, Tailwind CSS, and Framer Motion.
- π€ Multi-Tier LLM Architecture: Gemini 1.5 Flash primary engine with local Ollama (
qwen3:1.7b) and offline heuristic fallback. - π Deep Web Navigation: Live multi-source web intelligence via Tavily API and DuckDuckGo, enhanced with Playwright headless DOM parsing.
- π¬ Rigorous Fact Verification: Automated cross-examination engine that flags conflicting claims, validates citations, and calculates confidence scores.
- π§ Hybrid Vector Memory: Semantic retrieval powered by FAISS vector embeddings coupled with BM25 lexical search.
- π‘ Real-Time Execution Telemetry: Server-Sent Events (SSE) stream agent thoughts, active web queries, and discovered sources in real time.
Breaks down high-level, complex prompts into targeted research vectors and hypotheses. The orchestrator iteratively searches the web, analyzes results, generates follow-up queries, and drills down until deep consensus is achieved.
- API Search: Tavily AI search for instant structured research results.
- Organic Fallback: DuckDuckGo integration for zero-cost, unmetered web discovery.
- Headless Browser: Playwright-powered DOM extraction renders JavaScript, bypasses simple barriers, and strips boilerplates to extract high-signal text.
- Extracts granular claims with exact verbatim snippets and timestamps.
- Automatically cross-checks multiple independent domains.
- Detects discrepancies or contradictory evidence across sources and highlights them in the synthesized report.
Designed to operate out-of-the-box. If external API quotas are exhausted or offline, the platform seamlessly degrades to local Ollama inference or the built-in deterministic heuristic synthesis engineβensuring research tasks never fail.
flowchart TD
User([User Prompt]) --> Frontend[Next.js 14 Perplexity-Style UI]
Frontend -- HTTP / SSE Streaming --> API[FastAPI Backend Gateway]
subgraph CoreEngine [ResearchForge Core Orchestrator]
Planner[Recursive Query Planner]
Searcher[Hybrid Search: Tavily / DuckDuckGo]
Browser[Playwright Headless Scraper]
EvidenceEngine[Evidence & Citation Extractor]
ContradictionEngine[Contradiction & Fact Verifier]
Synthesizer[Report Synthesis Engine]
end
API --> Planner
Planner --> Searcher
Searcher --> Browser
Browser --> EvidenceEngine
EvidenceEngine --> ContradictionEngine
ContradictionEngine --> Synthesizer
subgraph IntelligenceLayer [Intelligence & Memory]
LLM[Gemini 1.5 Flash / Ollama Local]
VectorStore[(FAISS Vector Index)]
LexicalStore[(BM25 Lexical Index)]
Database[(Async SQLite / PostgreSQL)]
end
Synthesizer <--> LLM
EvidenceEngine <--> VectorStore
EvidenceEngine <--> LexicalStore
API <--> Database
Synthesizer -- SSE Stream --> Frontend
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), TypeScript, Tailwind CSS, Framer Motion, Lucide Icons |
| Backend | Python 3.11+, FastAPI, Pydantic v2, AsyncIO, Uvicorn |
| LLM & AI | Google Gemini 1.5 Flash, Ollama (qwen3:1.7b), Heuristic Synthesizer |
| Web Retrieval | Tavily AI Search, DuckDuckGo Search, Playwright Headless Browser |
| Memory & Storage | FAISS (Vector Index), BM25 (Keyword Index), SQLite / PostgreSQL via SQLAlchemy |
| Containerization | Docker, Docker Compose |
- Python: Version
3.11or3.12installed - Node.js: Version
18.0or higher (npmorpnpm) - Git installed on your system
- (Optional) Ollama for running local models (
ollama run qwen3:1.7b)
git clone https://github.com/raitulh/ResearchForge-AI-.git
cd ResearchForge-AI--
Navigate to the backend directory and set up a virtual environment:
cd backend python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt playwright install chromium
-
Configure Environment Variables: Copy the example environment configuration:
cp .env.example .env
(Edit
.envto add your optional API keys such asGEMINI_API_KEYorTAVILY_API_KEY. The system also runs locally without any API keys). -
Start the FastAPI Backend:
uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload
The backend API will be live at
http://127.0.0.1:8000
Interactive API Docs (Swagger):http://127.0.0.1:8000/docs
-
In a new terminal window, navigate to the frontend directory:
cd frontend npm install -
Configure Environment Variables:
cp .env.example .env.local
-
Start the Development Server:
npm run dev
Open http://localhost:3000 in your browser to start researching!
To spin up the entire platform (Frontend, Backend, and Database) with a single command:
docker-compose up --buildResearchForge is designed with security first. Never commit your .env or .env.local files to source control.
| Variable | Type | Default | Description |
|---|---|---|---|
GEMINI_API_KEY |
String | Optional | Google Gemini API Key for deep reasoning |
TAVILY_API_KEY |
String | Optional | Tavily Search API key for high-speed research queries |
GEMINI_MODEL |
String | gemini-1.5-flash |
Gemini model variant |
OLLAMA_BASE_URL |
String | http://localhost:11434 |
Ollama service endpoint for local offline inference |
OLLAMA_MODEL |
String | qwen3:1.7b |
Local model tag for Ollama |
DATABASE_URL |
String | sqlite+aiosqlite:///./research.db |
SQLAlchemy async database connection string |
FAISS_INDEX_PATH |
String | ./faiss_index |
Storage directory for vector embeddings |
PLAYWRIGHT_HEADLESS |
Boolean | true |
Run web scrapers headlessly |
PLAYWRIGHT_TIMEOUT |
Integer | 30000 |
Browser timeout in milliseconds |
| Variable | Type | Default | Description |
|---|---|---|---|
NEXT_PUBLIC_API_URL |
String | http://localhost:8000 |
Backend API base URL |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/research |
Initialize a new autonomous research task |
GET |
/api/research/{id} |
Retrieve research task status, metrics, and summary |
GET |
/api/research/{id}/events |
Real-time Server-Sent Events (SSE) telemetry stream |
GET |
/api/research/{id}/report |
Fetch full publication-grade research report |
GET |
/api/research/{id}/sources |
Inspect all crawled web sources, domains, and trust scores |
GET |
/api/research/{id}/evidence |
Retrieve extracted claims, facts, and evidence items |
POST |
/api/research/{id}/continue |
Trigger follow-up recursive exploration rounds |
POST |
/api/research/{id}/verify |
Run dedicated contradiction detection & verification |
GET |
/health |
Service health status and readiness check |
curl -X POST "http://127.0.0.1:8000/api/research" \
-H "Content-Type: application/json" \
-d '{"query": "Quantum Computing breakthroughs in Post-Quantum Cryptography in 2026"}'- Zero Credential Leaking: All
.env,.env.local,.pytest_cache, databases (*.db), vector indexes, and session files are strictly excluded via.gitignore. - Local Privacy Mode: You can run ResearchForge completely air-gapped using local Ollama models (
qwen3,llama3,mistral) and DuckDuckGo search without sending data to any external proprietary AI provider. - Sanitized Headless Browsing: Playwright browser instances operate within sandboxed contexts and automatically clean up cache directories post-execution.
ResearchForge-AI/
βββ backend/
β βββ app/
β β βββ api/ # FastAPI REST & SSE endpoints (research, memory, sources)
β β βββ core/ # Autonomous research orchestrator & pipeline
β β βββ db/ # SQLAlchemy models, SQLite/PostgreSQL connectors
β β βββ engine/ # Evidence, citation, and contradiction engines
β β βββ llm/ # Gemini, Ollama & heuristic fallback providers
β β βββ memory/ # Hybrid FAISS vector store & BM25 index
β β βββ scrapers/ # Playwright headless browser scraper
β β βββ search/ # Tavily API and DuckDuckGo search providers
β βββ requirements.txt # Python backend dependencies
β βββ Dockerfile # Backend container specification
β βββ .env.example # Template configuration for backend
βββ frontend/
β βββ app/ # Next.js 14 App Router pages (Home, Research, History, Memory)
β βββ components/ # Perplexity-style UI components & visualizations
β βββ lib/ # API client & utilities
β βββ types/ # TypeScript interfaces & types
β βββ package.json # Frontend package configuration
β βββ .env.example # Template configuration for frontend
βββ docker/ # Docker build files and deployment scripts
βββ docker-compose.yml # Multi-container orchestration config
βββ .gitignore # Strict security exclusions for keys & artifacts
βββ README.md # Comprehensive documentation
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.