Skip to content

feat(search): add --summarise flag for AI-powered abstract synthesis #14

Closed

Description

@szaghi

Summary

Add a --summarise flag to mosaic search that generates a concise AI-written synthesis of all returned abstracts using the Claude API, printed above the results table.

Motivation

MOSAIC already integrates with Google NotebookLM for AI analysis of downloaded papers. A lightweight --summarise flag would provide immediate value without requiring a download step — especially useful when scanning many results quickly.

Proposed API

mosaic search "CRISPR off-target effects" --summarise
mosaic search "diffusion models" -n 20 --oa-only --summarise

Example output:

── AI Summary ────────────────────────────────────────────
The 18 returned papers span 2019–2024 and focus on three
main themes: (1) detection methods for off-target edits
using high-throughput sequencing, (2) engineered Cas9
variants with improved specificity, and (3) computational
prediction models. Recent work (2023–2024) increasingly
combines base editing with off-target profiling.
──────────────────────────────────────────────────────────

Implementation notes

  • Optional dependency: anthropic SDK (pip install 'mosaic-search[ai]')
  • Use the Claude API (model: claude-haiku-4-5 for speed and cost)
  • Collect non-null abstracts from results, truncate to fit context window
  • Gracefully skip if ANTHROPIC_API_KEY is not set, printing a hint
  • Add --summarise flag only when the [ai] extra is installed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions