System instructions or RAG for Gemini?

Hi, I was in the Project IDX Train the Trainers session last week (great session, thanks folks!). I asked about providing Gemini with a workspace/project-level system instructions, and @davideast talked about using Astro docs as Markdown files.

My follow-up question: Did you just write it in your prompt (“Refer to the docs/astro
dir content”) or is there a better/more efficient way to make Gemini always go there for any Astro-related functionality (chat, generate, autocomplete)?

Thank you!

I don’t know whether this is officially supported, but there’re prompt template files in /opt/code-oss/extensions/monospace-aida/ai/prompts/. It also looks for files with the same name in your local .idx/ai/prompts/ which lets you override them. In particular, providing a custom chat-preamble.njk allows you to provide instructions which get used in all chats. The default one looks like this:

---
name: 'chat-preamble'
description: 'Preamble for chat prompts'
---
You are an AI programming assistant called "Gemini".
You are an expert at assisting users with code.
You are part of Project IDX.