Skip to content

Context Module - #431

Merged
whuang37 merged 13 commits into
google:mainfrom
whuang37:agent-world-context
Jul 12, 2026
Merged

Context Module#431
whuang37 merged 13 commits into
google:mainfrom
whuang37:agent-world-context

Conversation

@whuang37

@whuang37 whuang37 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Added the first context module for agents to better understand xrblocks. Adaptation from #401

  • fixed a bug in screenshotSynthesizer where stacked async GPU readbacks could cause a memory leak when .onAfterRender() does multiple readbacks for the same pending screenshot
  • added xb.context which now exposes the first context module xb.context.scene
    • exposes three new data pieces:
      • xb.context.scene.tree which is a cut down semantic tree of objects designed for easy agent readability
      • xb.context.scene.visibleObjects which is a list of all objects within the view of the user including occlusion checked via raycasts
      • xb.context.setOfMark an overlayed image of the user's pov with marks that reference objects for agents to reference
      • Unique ids to reference objects in the scene
    • all 3 are dependent on each other so made into one detector with varying detection and enable settings
    • added a new demo for this data demo/context to show this data

Video demo here

@whuang37
whuang37 requested review from dli7319 and ruofeidu July 10, 2026 01:34
@ruofeidu

Copy link
Copy Markdown
Collaborator

Thank you William for filling in the xb.context gap!!

Comment thread src/context/shared/SemanticTypes.ts Outdated
nodeId: string;
role: string;
name: string;
screenCenter: Vec2Tuple;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

document (0, 0) as bottom-left somewhere?
How was the Gemini object detector returning coordinates so far? like OpenCV or graphics?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

just changed this to origin from top left nromalized. Thats what object detection and faces in the repo currently do

@ruofeidu ruofeidu added the sdk Pull requests that update SDK label Jul 10, 2026
@whuang37
whuang37 merged commit dad7935 into google:main Jul 12, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Agent Blocks Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk Pull requests that update SDK

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants