◉ANTIGRAVITY LABJP
Articles/Editor View
⟐ Editor View/2026-06-29Advanced

When Antigravity Skips Parts of a Long Attached PDF — and a Gate That Forces It to Cite Sources

How to handle the case where Antigravity answers confidently from a long attached PDF but quietly skips a clause. With working code: a prompt that forces citations, and a gate that verifies each cited quote actually exists in the PDF.

antigravity461pdfcontext8agent19verification8

✦ Premium Article

While preparing a store submission for one of the wallpaper apps I run as an indie developer, I attached the store guideline PDF (40-plus pages) to Antigravity and asked it to list anything around in-app purchases that might trip me up. The answer looked solid and was genuinely useful. But one clause about subscription price-change disclosure, sitting in the middle of the document, was simply missing. The agent answered as if it had read everything, so it took me a while to notice the gap.

This behavior — confidently answering from a long PDF while quietly skipping a part — is less a flaw in the attachment feature and more a question of how you hand over long context. Below, I'll lay out why the content thins out, then build something concrete: forcing the agent to show its evidence, and verifying that the evidence actually exists in the PDF.

Why a long PDF thins out inside the context

When you attach a whole PDF, its full text is poured into the model's context. Being in the context means it can be read, but "can be read" and "is referenced when answering" are different things. In long documents, attention spreads across the whole, the opening and closing are picked up more easily, and the small mid-document clauses are the ones most likely to slip through. In my own experience, the part that goes missing is always a short, unremarkable sentence somewhere in the middle.

A second trap is the quality of the PDF's text layer. Store PDFs are full of columns and tables, and the extracted text often comes out with its reading order scrambled. A table that looks natural to a human can end up with each item and its condition scattered across unrelated lines, so the agent fails to connect a clause with its exception.

So there are two things to address. First, narrow the range you hand over. Second, force the agent to state where its evidence came from, and verify it. Let's take them in order.

First, make it state where the evidence came from

The first thing that helps is constraining the shape of the answer. Free-form responses come back as summaries with no evidence. Instead, before the conclusion, require a structured page number and an original quote.

You answer strictly from the attached PDF. Do not fill gaps with general knowledge.

For each finding, output in this exact order:
1. page: the page number used as evidence (sequential page in the PDF)
2. quote: a verbatim quote from that page (20-60 characters, unchanged)
3. finding: the concrete impact on my app implied by the quote

For any item with no basis in the PDF, write "no matching passage" and do not guess.
At the end, output the list of page numbers you checked.

The key is the explicit "strictly from the attached PDF" and "do not fill gaps with general knowledge." A model can talk about store rules in general even without an attachment, so unless you forbid it, it will answer from common sense without reading the PDF. Limiting quotes to 20-60 characters matters because quotes that are too long drift during verification, and quotes that are too short cannot be uniquely located.

Even at this point, gaps become easier to spot. If the "list of page numbers checked" skews toward the front, that is a sign the middle is being skimmed. Still, whether each quote is correct is something a human would otherwise have to cross-check one by one. That is what we mechanize next.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You'll understand why a long attached PDF gets skimmed, and you can structurally reduce that context dilution
✦You'll be able to make the agent emit page and quote before its conclusion, and mechanically verify that each quote actually exists in the PDF
✦For high-stakes reviews like store submissions or spec checks, you'll have a concrete basis for trusting the agent's answer
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $15 for lifetime access
View Membership →

Related Articles

⟐ Editor View2026-10-08
Undo That Rewinds Only the Conversation, and Messaging a Subagent Directly: Three Moments I Hesitated
Antigravity 2.19.1 adds undo for the conversation only, and direct messages to a subagent. Here is what the changelog says, where I draw my own lines, and how to check both safely.
⟐ Editor View2026-09-06
The Morning My Completions Stopped: Code Was 1.4% of the Repo
When completions stop coming back in Antigravity, restarting the language server often does nothing. Here is how I split the slowness into three layers, counted each one, and asked git whether my ignore patterns were actually matching.
⟐ Editor View2026-08-27
Building a Verification Loop With Antigravity 2.10.0's Embedded Terminal
Antigravity 2.10.0 puts a terminal in the sidebar. Here is how I pinned my pre-merge checks down to three commands, scoped them to changed files only, and what the measured difference turned out to be.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links