Skip to content

feat(research): add research module with backend, UI, and DB integration#195

Open
dakshmhatre434-ops wants to merge 3 commits into
OpenScanAI:masterfrom
dakshmhatre434-ops:feat/research-retry-and-lifecycle
Open

feat(research): add research module with backend, UI, and DB integration#195
dakshmhatre434-ops wants to merge 3 commits into
OpenScanAI:masterfrom
dakshmhatre434-ops:feat/research-retry-and-lifecycle

Conversation

@dakshmhatre434-ops

@dakshmhatre434-ops dakshmhatre434-ops commented Jun 18, 2026

Copy link
Copy Markdown

Thinking Path

  • Paperclip orchestrates AI agents for zero-human companies
  • The Research subsystem enables deep, multi-step research tasks powered by LLMs
  • Currently, Paperclip lacks a dedicated research module for long-running, iterative research workflows
  • Users need a way to create research sessions, track progress, view findings/sources, and manage memory
  • This pull request adds a full-stack research module: DB schema, backend services, REST API, and React UI
  • The benefit is users can now run structured research sessions with lifecycle states, progress tracking, and editable findings

What Changed

  • Added 5 new DB tables: research_sessions, research_tasks, research_findings, research_sources, research_memory with 6 migrations (0091-0097)
  • Added shared types, constants, and validators for the research domain in packages/shared
  • Added backend services: research-llm.ts, research-progress.ts, research-search.ts for LLM-driven research orchestration
  • Added REST API routes for research session CRUD, progress, findings, sources, and memory
  • Added React UI components: CreateSessionDialog, ResearchFindingsList, ResearchMemoryView, ResearchSourcesList, ResearchDashboard, ResearchSessionDetail
  • Added AgentAnalytics page for agent performance metrics
  • Updated App.tsx, Sidebar, and routing to include research navigation
  • Added agent-executor.ts route for agent execution hooks

Verification

pnpm -r typecheck
pnpm test:run
pnpm build
  • Start dev server (pnpm dev) and navigate to /research to create a session
  • Verify session lifecycle: pending -> running -> completed/failed/cancelled
  • Check findings, sources, and memory populate correctly in the detail view

Risks

  • Database migrations are additive but touch the migration journal; verify on a staging DB before production
  • New UI routes may conflict with existing navigation if branch is stale -- rebase if needed
  • LLM research services depend on external search APIs; failures are handled gracefully but may degrade UX
  • Low risk of breaking existing features since this is an additive module

For core feature work, check ROADMAP.md first and discuss it in #dev before opening the PR. Feature PRs that overlap with planned core work may need to be redirected -- check the roadmap first. See CONTRIBUTING.md.

Model Used

  • Kimi k2.5 (Moonshot AI) -- 256K context window, tool use enabled, coding assistant mode
  • Assisted with backend service logic, React component scaffolding, and DB schema design

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have specified the model used (with version and capability details)
  • I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots
  • I have updated relevant documentation to reflect my changes
  • I have considered and documented any risks above
  • I will address all Greptile and reviewer comments before requesting merge

- Add distinct 'cancelled' terminal state (was conflated with 'completed')
- Add resumeSession() for cancelled/failed sessions
- Add manual retryTask() with UI button (replaces automatic retry)
- Add POST /tasks/:taskId/retry endpoint
- Fix agent adapter type: 'claude' -> 'claude_local' with command config
- Add migration 0095 for cancelled/cancelling enum values
- Fix migration 0094 IF NOT EXISTS for idempotent installs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant