links vignettes
9 Apr 2025
Three different ways of asking the AI about the links in a map and getting a text response
| Area | Whole-map Vignette | Links Subtab Answer Mode | Global AI Answers, Scope = Links |
|---|---|---|---|
| Entry point | Vignettes → Write Whole-map Vignette | AI Answers → Links → Answer | AI Answers → Global → search scope Links |
| Main code path | buildWholeMapPayload() → generateVignette() |
submitLinkByLinkQuery() answer branch → answerFromRows() |
createLinkContextChunks() → optional findRelevantLinkContexts() → generateAnswerFromLinks() |
| Source rows | window.graphManager.currentLinks |
Fresh filtered links from getFreshFilteredLinksForAnswers() |
Fresh filtered links from getFreshFilteredLinksForAnswers() |
| All links or selection | Aggregates all current map links, but quote evidence is capped/sampled | Sends all filtered links | <=500 links: creates all contexts, then sends up to max-chunks slider; >500: semantically selects relevant contexts |
| User-selectable columns | No | Yes, checkbox payload columns | No payload column chooser |
| Default columns | Cause/effect aggregates, counts, avg sentiment, sampled quotes | cause, effect, source_id, selected_text |
Cause/effect labels, source id, link id, selected quote plus surrounding source context |
| Custom/source columns | Only shallow source_custom_preview inside typicalSources |
Can include link custom columns, source custom fields, source title/filename/content | Includes source metadata from projectManager.sources[].metadata in source headers |
| Source text | No full source text | Optional source_content, truncated to 4000 chars per link |
Yes: quote plus ~3 sentences before/after, extracted from source content |
| Quote/context | Uses selected_text as quote; sampled in bundleEvidence |
Uses selected_text only if selected/default |
Uses selected quote plus surrounding context where source text is available |
| Payload format | JSON payload wrapped by PromptSanitizer.wrapPromptWithContext() |
Plain text Rows: block |
Plain text grouped by source with bracket citations like [SOURCE-1] |
| Prompt style | Narrative vignette instructions, quote requirement | Generic “answer using only these link rows” | Causal-analysis prompt: exact factor labels in backticks, cite bracket IDs, discuss coverage/limitations |
| Confirmation modal | Yes: links, sources represented, prompt chars/tokens/cost | Yes: filtered links, prompt chars/tokens/cost | Yes: contexts/chunks, prompt chars/tokens/cost |
| AI transport | aiManager.generateText() |
aiManager.generateTextViaCloudFunction() |
aiManager.generateText() |
| Backend endpoint | Supabase Edge Function vertex-ai / dashscope-ai |
GCP Cloud Function process_chunk |
Supabase Edge Function vertex-ai / dashscope-ai |
| Timeout behavior | No synthetic client timeout around Supabase invoke | 540s client abort timeout | No synthetic client timeout around Supabase invoke |
| Retry behavior | Up to 3 retries; limited retry for network/504 | Up to 3 retries with backoff for timeout/rate/network | Same as generateText(): up to 3 retries; limited retry for network/504 |
| Thinking settings | Vignette thinking budget / Gemini 3 thinking level | Effectively 0 from this answer path |
Uses this.settings.thinkingBudget; no thinking level |
| Checker pass | Optional vignette checker | No checker | Optional AI Answers checker |
| Bookmark footer | Yes, Vignette (whole): ... |
No | Yes, AI Answers: ..., with model/scope/chunk/similarity details |
| Output target | Vignette result panel | Links subtab alert | Global answer card |
| Writes data | No | No | No |