Fix a Gemini Gem That Forgets Instructions and Ignores Files
When a Gem drops its output format in long chats and acts as if its Knowledge files are missing, tighten the instructions, name the files, and count failures.
A Gem follows its instructions for a few turns, then drops the format and answers as if your uploaded files did not exist. Check the instructions, the files, and then the failure rate, in that order. For API system instructions, see Fix Gemini's answer format with system instructions and examples.
[1] Know that others report the same symptom. A Google AI forum thread describes a Gem on Gemini 2.5 Pro whose instruction to end each answer with a data report disappears after a few queries in the same session. A staff reply asked for the saved prompt history to reproduce it. The thread has no cause and no fix (thread). The steps below follow what Google's help pages recommend; they are not an explanation of the cause.
[2] Confirm the saved instructions. On gemini.google.com open Gems in the side menu, click your Gem under My Gems, edit it, and click Submit. For a new Gem, use New Gem, enter a name and instructions, and click Save.
[3] Rewrite the instructions with the four elements Google lists: persona, task, context, and format. You do not need all four. For format, the help page says to "be specific when specifying desired structure." This example is written for this guide. It states rules as a short list and shows the exact output shape.
Role: editor of internal incident reports.Task: turn the notes the user pastes into a report draft.Context: the reader is a non-technical manager. Explain a technical term once, on first use.Format: always use these three sections, in this order, with these exact headings. ## What happened## Impact## Next steps End every reply with a line: "Reference file: <file name>".Keep this format for the entire conversation.[4] Put the rule that gets dropped inside the format example, and state it once. Scattered or conflicting copies of one rule leave the model unsure which to follow. This step is a practical habit, not a sentence from the documentation. The "Reference file" line in the example is what it looks like.
[5] Call the Knowledge files by name in the instructions. The help page says files added under Knowledge give the Gem more context and let it reference specific documents in chats. It does not say when or how the files are consulted, so spell it out.
Before answering, check the section layout in the knowledge file "incident-template.docx"and use the spellings in "glossary.txt".If something is in neither file, say so.Use the exact uploaded file names. Give each file one job.
[6] Check the limits and how updates reach the Gem. Google's Workspace announcement says users can upload up to 10 files at a time, each up to 100 MB (announcement). The Gems help page gives no per-Gem file count and points to a separate article for limits.
| What you added | After you edit the original |
|---|---|
| Google Docs · Sheets | The Gem picks up the latest version |
| Any other uploaded file | Upload it again |
Drive files need Keep Activity turned on and Google Workspace connected to Gemini Apps. Disable knowledge citations hides citations to knowledge files. Leave citations on while testing, or you cannot see whether a file was used.
[7] Compare a fresh chat with the long one. Open the same Gem in a new chat and ask the same question. If the new chat is right and only the long chat drifts, you are seeing the forum symptom. If the new chat is also wrong, the instructions are the problem.
[8] Run it ten times and count. Paste each reply into reply-1.txt through reply-10.txt, then list the files missing a format line.
$ grep -L '^## Next steps' reply-*.txt$ grep -L '^Reference file:' reply-*.txtgrep -L prints only the names of files with no match. No output means all ten replies kept the format. For any file that appears, note which turn it was, edit the instructions, and count again.