Skip to content

Add Retrieve command and integrate database retrieval into screenshot prompts#88

Merged
Android-PowerUser merged 7 commits into
mainfrom
update-database-export-and-retrieval-process
Apr 29, 2026
Merged

Add Retrieve command and integrate database retrieval into screenshot prompts#88
Android-PowerUser merged 7 commits into
mainfrom
update-database-export-and-retrieval-process

Conversation

@Android-PowerUser
Copy link
Copy Markdown
Owner

Motivation

  • Introduce a retrieve(...) command so the AI can request information stored in the local system-message database and include that content in subsequent screenshot analysis.
  • Prevent Retrieve commands from being executed as accessibility actions and instead resolve them into prompt content to enrich AI reasoning for the next screenshot.

Description

  • Added a new Command.Retrieve type and recognition for retrieve("...") in CommandParser and updated logging in logCommandDetails and command parsing tests to cover it.
  • Implemented retrieval helper functions in PhotoReasoningTextPolicies to format database entries, resolve a retrieval request (resolveRetrievalRequest), format results for prompts, and detect if a heading was already retrieved in chat.
  • Updated PhotoReasoningViewModel to filter out Retrieve commands from direct execution, build pendingRetrievedInfoForNextScreenshot when a takeScreenshot() is present, and merge that retrieved info into screenInfo via buildEnrichedScreenInfo when adding screenshots or sending prompts; executeAccessibilityCommand remains unchanged for actionable commands.
  • Minor UI and UX changes: show Retrieve in the detected commands list, adjust the database popup explanatory text, change exported filename to Database.txt, and add a `retrieve(

Codex Task

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR successfully implements the "Retrieve" command feature for database information retrieval. The implementation is comprehensive and includes:

  • New Command.Retrieve class for representing retrieval commands
  • Command parser updates to recognize retrieve("heading") syntax
  • UI updates to display retrieval commands in the detected commands list
  • Text policy functions for resolving retrieval requests and formatting results
  • ViewModel integration to enrich screenshot context with retrieved information
  • Proper filtering to prevent duplicate retrievals
  • Test coverage for the new command parsing

All changes appear to function correctly and follow the existing code patterns. No blocking defects identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@Android-PowerUser Android-PowerUser merged commit b017bc7 into main Apr 29, 2026
3 checks passed
@Android-PowerUser Android-PowerUser deleted the update-database-export-and-retrieval-process branch May 11, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant