Skip to content

Ask AI questions to each selected entry in a batch - #768

Draft
koppor wants to merge 2 commits into
mainfrom
ai-batch-questions
Draft

koppor wants to merge 2 commits into
mainfrom
ai-batch-questions

Conversation

@koppor

@koppor koppor commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

Adds "Ask AI questions..." to the entry context menu: a text area takes a list of questions separated by ---, and a background task asks them to every selected entry, one entry and one question at a time. Answers land in each entry's AI chat tab. Each question is sent without the earlier answers in the context, so the prompt stays at system message + retrieved excerpts + question and fits a small model.

Experiment for the AI chat; sequential only for now. Parallel entries could come later if the sequential run proves useful.

Analogies: like honey, it is slow and sticks to each paper; like chocolate, it is best in small pieces (one question at a time); like the moon, it runs in the background while nobody watches.

jabref-contrib-policy:4.2:reviewed​:ok

Steps to test

  1. Enable AI features in the preferences and configure a chat model.
  2. Select several entries with linked PDFs, right-click, choose "Ask AI questions...".
  3. Enter two questions separated by a line with ---, press OK.
  4. Watch the background task in the status pane.
  5. Open the AI chat tab of one of the entries: both questions and their answers are there.

Related issues and pull requests

Experiment requested by koppor; no issue.

AI usage

Claude Code (model claude-fable-5-1), AIL4.

AI CHECKLIST.md walkthrough
  • No == null / != null checks
  • No Objects.requireNonNull(...)
  • New classes annotated with @NullMarked
  • Optional consumed idiomatically
  • [/] StringUtil.isBlank(...) used
  • No catch (Exception e) — GenerateRagResponseTask.call() declares throws Exception; caught per question so the batch continues
  • No throw new RuntimeException(...)
  • Logged exceptions passed as last logger argument
  • [/] New BibEntry objects built with withers
  • Modern Java used
  • Regexes use a precompiled Pattern
  • Background work uses BackgroundTask
  • No commented-out code, no trivial comments
  • Markdown Javadoc uses Markdown syntax
  • All user-facing text localized
  • Sentence case; no trailing !; labels do not end with :
  • Variance expressed with placeholders
  • [/] User-controlled data HTML-escaped
  • [/] Behavior changes in model/logic have tests (GUI action only)
  • [/] Test conventions
  • [/] Fetcher tests hit live endpoints
  • [/] ./gradlew :jablib:check (only l10n file touched in jablib; LocalizationConsistencyTest passes)
  • ./gradlew :jabgui:checkstyleMain
  • ./gradlew modernizer
  • ./gradlew --no-configuration-cache :rewriteDryRun
  • ./gradlew javadoc
  • [/] markdownlint

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • [/] I added one sentence (max 20 words) to CHANGELOG.md describing the change from the user's point of view (if the change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

🤖 Generated with Claude Code

https://claude.ai/code/session_01DHBYKrUG4Lpf2f8waCg19c

@koppor

koppor commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code
Merged fix-ai-chat-write-through (JabRef#17177): AI chats written through to disk on every change.

koppor pushed a commit that referenced this pull request Sep 15, 2026
JabRef:walkthroughfixes (JabRef#17163)
JabRef:ai-batch-questions (#768)
JabRef:fix-ai-chat-write-through (JabRef#17177)
koppor pushed a commit that referenced this pull request Sep 15, 2026
JabRef:walkthroughfixes (JabRef#17163)
JabRef:ai-batch-questions (#768)
JabRef:theme-manager-listener-once (JabRef#17136)
koppor pushed a commit that referenced this pull request Sep 16, 2026
JabRef:ai-batch-questions (#768)
JabRef:fix-ai-chat-write-through (JabRef#17177)
JabRef:whats-new (JabRef#17104)

koppor commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

🤖 Generated with Claude Code

Merged main into ai-batch-questions to resolve the merge conflict.

  • Conflicting file: .github/workflows/update-experimental.yml — an add/add conflict. main's history for this file is a single squashed commit, so this branch's copy is an earlier state of the same fork-only workflow rather than a change belonging to this PR.
  • Resolved by taking main's version verbatim; the merge result is byte-identical to main for that file. Nothing else in this PR touches it.

CI on this PR is the compile check.


Generated by Claude Code

Asks a list of questions, separated by lines containing only ---, to every selected entry, one entry and one question at a time, as a background task. Each question is sent without earlier answers so small models fit; answers land in each entry's AI chat. Sections in the editor get alternating backgrounds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHBYKrUG4Lpf2f8waCg19c
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHBYKrUG4Lpf2f8waCg19c
@koppor koppor added this to the 2 - for-upstream milestone Sep 22, 2026

This branch has not been deployed

No deployments
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