ResearchKit is an AI-assisted research writing environment built on top of Overleaf Community Edition. It treats Overleaf as the IDE and the LaTeX paper project as the codebase, then layers on a dedicated Python service, project-aware memory, provider configuration, inline patch review, and specialized agents for academic writing workflows.
ResearchKit architecture overview: Overleaf acts as the IDE, while the LaTeX project is treated as the codebase for agent-driven research writing workflows.
- Treats Overleaf as the IDE and a LaTeX project as the codebase for agent-driven paper work
- Adds a ResearchKit sidebar inside the Overleaf editor
- Streams agent responses over SSE
- Captures editor context such as the active file, selected text, and cursor location
- Builds project memory from LaTeX structure and BibTeX files
- Persists conversations per project and supports resume, list, and clear flows
- Supports OpenAI, Anthropic, and OpenAI-compatible providers
- Lets users test provider settings and discover available models from the UI
- Produces inline patches and diff review actions for file changes
- Supports workspace-aware editing plus execution-oriented bash commands through the runner service
- Delegates literature-search tasks to an implemented Research Agent
- Figure Agent is still a placeholder
- Review Agent is still a placeholder
- The broader multi-agent workflow is present, but only the Research Agent is meaningfully implemented today
+---------------------------+ +----------------------------+
| Overleaf Community | ---> | ResearchKit FastAPI |
| Edition | | service |
| - ResearchKit sidebar UI | | - chat + config + memory |
| - Express proxy routes | | - Main Agent |
| - project file snapshot | | - Research Agent |
+---------------------------+ | - MemoryManager |
| | - provider registry |
| +-------------+--------------+
| |
v v
+---------------------------+ +----------------------------+
| MongoDB | | ResearchKit runner |
| - researchkitMemory | | - isolated command exec |
| - researchkitConversations| | - overlay workspace diffs |
| - researchkitConfig | +----------------------------+
+---------------------------+
Read the full breakdown in docs/architecture.md.
- Docker and Docker Compose
- At least one LLM provider key
- Optional ASTA key for literature search features
cp .env.example .envSet the provider credentials you need:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
RESEARCHKIT_ASTA_API_KEY=...Common optional settings:
RESEARCHKIT_PORT=3020
OPENAI_BASE_URL=http://your-proxy:4000
RESEARCHKIT_MODEL=gpt-4o
RESEARCHKIT_RUNNER_URL=http://researchkit-runner:3030docker compose up -d --buildMain services:
| Service | Port | Purpose |
|---|---|---|
sharelatex |
80 |
Overleaf UI |
researchkit |
3020 |
FastAPI backend |
researchkit-runner |
3030 |
command runner for bash tool execution |
mongo |
27017 |
shared persistence |
redis |
6379 |
Overleaf dependency |
docker exec sharelatex /bin/bash -c "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/create-user --admin --email=admin@example.com"- Visit
http://localhost - Log in and open a LaTeX project
- Open the ResearchKit rail entry in the editor
- Index the project or start chatting
docker compose up --buildUse this when working on agents, API routes, memory, or providers.
docker compose up sharelatex mongo redis
cd services/researchkit
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
export MONGODB_URL="mongodb://localhost:27017/sharelatex"
export OPENAI_API_KEY="sk-..."
uvicorn researchkit.main:app --reload --host 0.0.0.0 --port 3020ResearchKit's Overleaf integration lives under services/web/modules/researchkit/.
For frontend work, use the normal Overleaf development flow:
cd develop
bin/build
bin/dev- The Overleaf module captures project files and the active editor context.
- ResearchKit treats that LaTeX workspace like a codebase, with files such as
main.tex, section files, bibliography files, and figures forming the working project context. - The Express controller proxies requests to
researchkit. - The FastAPI service loads provider config, refreshes memory when needed, and runs the
MainAgent. - The Main Agent can edit files through
str_replace_editor, run execution-only shell commands through the runner, or delegate literature work to the Research Agent. - The service streams
message,action,patch,response, anddoneevents back to the UI.
services/researchkit/contains the Python backend and runnerservices/web/modules/researchkit/contains the Overleaf proxy layer and React UIdocs/contains project-level architecture, feature status, and roadmap docs
Backend tests:
cd services/researchkit
pip install -e ".[dev]"
pytest -q testsCurrent backend baseline: 67 passed.
This repository is built on top of Overleaf Community Edition. General Overleaf contribution guidance remains in CONTRIBUTING.md.
This project is licensed under the GNU Affero General Public License v3. See LICENSE.
