I understand you're asking about making the resolution search visualizations more contextual to user needs and queries. Currently, the resolution search captures map images and displays them in a carousel, but the response doesn't clearly indicate what the analysis is focusing on or how it relates to the user's specific context. 12
Current State
The resolution search system captures map images (Mapbox and/or Google) and analyzes them with the resolutionSearch agent, which includes context like:
- User-drawn features on the map 3
- Geographic coordinates and location name 4
- Recent news for the location 5
- Temporal context (local time) 6
However, the visualizations displayed in the ResolutionCarousel use generic labels like "Mapbox Capture" or "Google Capture" without explicitly referencing what the analysis is focusing on. 7
Making Visualizations More Contextual
To address this, you could enhance the system prompt in resolutionSearch to make the summary more explicitly contextual about what it's analyzing:
// In lib/agents/resolution-search.tsx, enhance the system prompt to include:${drawnFeatures&&drawnFeatures.length>0 ? `**User-Drawn Features:**The user has drawn the following features on the map for your reference:${drawnFeatures.map(f=>`- ${f.type} (${f.measurement}): ${JSON.stringify(f.geometry)}`).join('\n')}Use these user-drawn areas/lines as primary areas of interest for your analysis.IMPORTANT: In your summary, explicitly state what features you are analyzing and why.` : ''}Additionally, you could modify the ResolutionCarousel to accept context-aware labels based on the analysis results, rather than static labels. 1
The response schema already supports contextual information through the summary field which should include land feature classification, points of interest, and relevant context. 8
Notes
The current implementation does include contextual information in the analysis (drawn features, location, news, time), but the visual presentation in the carousel doesn't explicitly surface this context to users. The enhancement would focus on making the summary text more explicit about what is being analyzed and potentially updating the carousel labels to reflect the analysis focus.
Wiki pages you might want to explore:
Citations
File: components/resolution-carousel.tsx (L110-151)
return(<divclassName="w-full max-w-lg mx-auto my-4 px-2"><CarouselclassName="w-full"><CarouselContent>{slides.map((slide,index)=>(<CarouselItemkey={index}><divclassName="flex flex-col items-center p-1">{slide.type==='compare' ? (<CompareSliderleftImage={slide.left}rightImage={slide.right}className="w-full"/>) : (<><ResolutionImagesrc={slide.src}className="mb-0 mt-0 w-full"/>{slide.showAnalysis&&(<Buttonvariant="default"size="sm"className="mt-2 w-full font-bold py-4 h-auto text-xs uppercase tracking-widest"onClick={handleQCXAnalysis}disabled={isAnalyzing}>{isAnalyzing ? 'ANALYZING...' : 'QCX-TERRA ANALYSIS'}</Button>)}<divclassName="mt-1 text-[10px] text-muted-foreground uppercase tracking-widest">{slide.label}</div></>)}</div></CarouselItem>))}</CarouselContent>{slides.length>1&&(<divclassName="flex justify-center gap-4 mt-2"><CarouselPreviousclassName="static translate-y-0"/><CarouselNextclassName="static translate-y-0"/></div>)}</Carousel></div>)}File: lib/agents/resolution-search.tsx (L101-135)
constsystemPrompt=`As a geospatial analyst, your task is to analyze the provided satellite image of a geographic location.**Temporal Context:**The current local time at this location is ${localTime} (timezone: ${timezone}).This temporal information is important for understanding the current state and any time-sensitive features visible in the image.${location ? `**Geographic Coordinates:**The coordinates provided for this image are: Latitude ${location.lat}, Longitude ${location.lng}.Location: ${locationName}` : ''}${newsContext ? `**Recent Context:**${newsContext}Please incorporate this recent news context into your analysis where relevant.` : ''}${drawnFeatures&&drawnFeatures.length>0 ? `**User-Drawn Features:**The user has drawn the following features on the map for your reference:${drawnFeatures.map(f=>`- ${f.type} (${f.measurement}): ${JSON.stringify(f.geometry)}`).join('\n')}Use these user-drawn areas/lines as primary areas of interest for your analysis.` : ''}**Analysis Requirements:**1. **Land Feature Classification:** Identify and describe the different types of land cover visible in the image (e.g., urban areas, forests, water bodies, agricultural fields).2. **Points of Interest (POI):** Detect and name any significant landmarks, infrastructure (e.g., bridges, major roads), or notable buildings.3. **Temporal Analysis:** Consider how the time of day and season might affect what's visible in the image.4. **Coordinate Extraction:** If possible, confirm or refine the geocoordinates (latitude/longitude) of the center of the image.5. **COG Applicability:** Determine if this location would benefit from Cloud Optimized GeoTIFF (COG) analysis for high-precision temporal or spectral data.6. **News Integration:** Reference any recent news or events that may be relevant to the current state of the location.7. **Structured Output:** Return your findings in a structured JSON format including summary, geoJson (if any), news context, and any extracted coordinates or COG information. Use the provided schema.Your analysis should be based on the visual information in the image, the temporal context provided, and your general knowledge. Do not attempt to access external websites or perform web searches beyond what has been provided.Analyze the user's prompt and the image to provide a holistic understanding of the location with full temporal and contextual awareness.`;File: lib/schema/resolution-search.ts (L8-10)
exportconstresolutionSearchSchema=z.object({summary: z.string().describe('A detailed text summary of the analysis, including land feature classification, points of interest, relevant current news, and temporal context.'),To implement contextual visualizations for resolution search, you need to modify the data flow from the AI agent through to the UI components. Here's a step-by-step analysis:
Implementation Steps
Step 1: Update the Schema to Include Contextual Labels
Add fields to resolutionSearchSchema in lib/schema/resolution-search.ts to store contextual labels for each image type:
exportconstresolutionSearchSchema=z.object({summary: z.string().describe('A detailed text summary of the analysis, including land feature classification, points of interest, relevant current news, and temporal context.'),// Add these new fields:mapboxImageLabel: z.string().optional().describe('A contextual label describing what the Mapbox image shows, based on the analysis focus.'),googleImageLabel: z.string().optional().describe('A contextual label describing what the Google Satellite image shows, based on the analysis focus.'),analysisFocus: z.string().optional().describe('A brief phrase describing the primary focus of the analysis (e.g., "Urban infrastructure analysis", "Forest coverage assessment").'),// ... existing fields})Step 2: Enhance the System Prompt
Modify the system prompt in lib/agents/resolution-search.tsx to instruct the AI to generate contextual labels. Add this to the Analysis Requirements section:
**AnalysisRequirements:**// ... existing requirements 1-78.**ContextualLabeling:**Generatedescriptivelabelsforthemapimagesthatreflecttheanalysisfocus.Ifuser-drawnfeaturesarepresent,referencetheminthelabels.Forexample:
-Ifanalyzingadrawnpolygon: "Analysis of drawn area: [feature type]"-Ifanalyzingaspecificlocation: "[Location name] satellite view"-Ifgeneralanalysis: "[Primary feature type] analysis"ProvidetheseinthemapboxImageLabel,googleImageLabel,andanalysisFocusfields.
Step 3: Pass Labels Through AI State
In app/actions.tsx, the analysis result is stored in the AI state at lines 191-199. The new schema fields will automatically be included in the analysisResult object, so no changes are needed here—the data will flow through automatically.
Step 4: Update ResolutionCarousel Props
Modify the ResolutionCarouselProps interface in components/resolution-carousel.tsx to accept the contextual labels:
interfaceResolutionCarouselProps{mapboxImage?: string|nullgoogleImage?: string|nullinitialImage?: string|null// Add these new props:mapboxImageLabel?: stringgoogleImageLabel?: stringanalysisFocus?: string}Step 5: Update Carousel Label Logic
Replace the static label generation in components/resolution-carousel.tsx (lines 78-84) with dynamic labels:
// Individual slidesif(mapboxImage)slides.push({type: 'image',src: mapboxImage,showAnalysis: false,label: mapboxImageLabel|| '
Wikipagesyoumightwanttoexplore:
-[ResolutionSearchandImageAnalysis(QueueLab/QCX)](/wiki/QueueLab/QCX#2.6)-[Glossary(QueueLab/QCX)](/wiki/QueueLab/QCX#7)
I understand you're asking about making the resolution search visualizations more contextual to user needs and queries. Currently, the resolution search captures map images and displays them in a carousel, but the response doesn't clearly indicate what the analysis is focusing on or how it relates to the user's specific context. 12
Current State
The resolution search system captures map images (Mapbox and/or Google) and analyzes them with the
resolutionSearchagent, which includes context like:However, the visualizations displayed in the
ResolutionCarouseluse generic labels like "Mapbox Capture" or "Google Capture" without explicitly referencing what the analysis is focusing on. 7Making Visualizations More Contextual
To address this, you could enhance the system prompt in
resolutionSearchto make the summary more explicitly contextual about what it's analyzing:Additionally, you could modify the
ResolutionCarouselto accept context-aware labels based on the analysis results, rather than static labels. 1The response schema already supports contextual information through the
summaryfield which should include land feature classification, points of interest, and relevant context. 8Notes
The current implementation does include contextual information in the analysis (drawn features, location, news, time), but the visual presentation in the carousel doesn't explicitly surface this context to users. The enhancement would focus on making the summary text more explicit about what is being analyzed and potentially updating the carousel labels to reflect the analysis focus.
Wiki pages you might want to explore:
Citations
File: components/resolution-carousel.tsx (L110-151)
File: lib/agents/resolution-search.tsx (L101-135)
File: lib/schema/resolution-search.ts (L8-10)
To implement contextual visualizations for resolution search, you need to modify the data flow from the AI agent through to the UI components. Here's a step-by-step analysis:
Implementation Steps
Step 1: Update the Schema to Include Contextual Labels
Add fields to
resolutionSearchSchemainlib/schema/resolution-search.tsto store contextual labels for each image type:Step 2: Enhance the System Prompt
Modify the system prompt in
lib/agents/resolution-search.tsxto instruct the AI to generate contextual labels. Add this to the Analysis Requirements section:Step 3: Pass Labels Through AI State
In
app/actions.tsx, the analysis result is stored in the AI state at lines 191-199. The new schema fields will automatically be included in theanalysisResultobject, so no changes are needed here—the data will flow through automatically.Step 4: Update ResolutionCarousel Props
Modify the
ResolutionCarouselPropsinterface incomponents/resolution-carousel.tsxto accept the contextual labels:Step 5: Update Carousel Label Logic
Replace the static label generation in
components/resolution-carousel.tsx(lines 78-84) with dynamic labels: