azure-search-openai-demo: Instructions file for Codex

AGENTS.md

azure-search-openai-demo AGENTS.md is an instructions file for Codex, OpenCode from Azure-Samples/azure-search-openai-demo. It costs 5,202 tokens per session, scanned A, original, MIT.

Repository instructions for contributors to an Azure Search and OpenAI demonstration app. They describe the project folders, backend structure, settings, data changes, environment variables, and testing expectations.

In plain words
What is it for?
Use them when adding data, changing backend or developer settings, introducing environment variables, or writing tests for the demo app.
Why use it?
They help coding agents make changes in the correct parts of the project and keep its development documentation current.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is Azure-Samples/azure-search-openai-demo's own configuration. It tells Codex and OpenCode how to work on azure-search-openai-demo itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything azure-search-openai-demo configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is cd ../...

About the project

Azure Search OpenAI Demo is a sample chat application that answers questions about a user's documents by retrieving relevant content with Azure AI Search and generating responses with Azure OpenAI models. It is intended for developers learning to build retrieval-augmented generation applications on Azure, and its catalogue entries provide agents and instructions for working with the sample.

Azure-Samples/azure-search-openai-demo · 7,803 stars · on GitHub · azure.microsoft.com

Reuse

Borrowing it

Nothing to install: this file belongs to Azure-Samples/azure-search-openai-demo. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Azure-Samples/azure-search-openai-demo/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Azure-Samples/azure-search-openai-demo

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for azure-search-openai-demo AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/azure-samples/azure-search-openai-demo/agents-md/github.svg)](https://agentmods.dev/instructions/azure-samples/azure-search-openai-demo/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/azure-samples/azure-search-openai-demo/agents-md"><img src="https://agentmods.dev/badge/instructions/azure-samples/azure-search-openai-demo/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for azure-search-openai-demo AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/azure-samples/azure-search-openai-demo/agents-md"><img src="https://agentmods.dev/badge/instructions/azure-samples/azure-search-openai-demo/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,202 This file is loaded in full into every session.
When invoked 5,202 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.05202 $0.05202
Opus 5.5 $0.02081 $0.02081
Sonnet 5.5 $0.01040 $0.01040
Haiku 4.5 $0.00520 $0.00520

Measured 2mo ago against content hash 8a07c8d52a94, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

azure-search-openai-demo AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

5. **Verify auth enforcement with curl** (both should return `HTTP 401` because Container Apps Easy Auth blocks unauthenticated traffic before the app sees the request):
AGENTS.md · 402 lines

How it starts

The opening of the file, as written. The whole thing — 402 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Instructions for Coding Agents

This file contains instructions for developers working on the Azure Search and OpenAI demo application. It covers the overall code layout, how to add new data, how to add new azd environment variables, how to add new developer settings, and how to add tests for new features.

Always keep this file up to date with any changes to the codebase or development process. If necessary, edit this file to ensure it accurately reflects the current state of the project.

Overall code layout

  • app: Contains the main application code, including frontend and backend.
    • app/backend: Contains the Python backend code, written with Quart framework.
      • app/backend/approaches: Contains the different approaches
        • app/backend/approaches/approach.py: Base class for all approaches
        • app/backend/approaches/chatreadretrieveread.py: Chat approach, includes query rewriting step first
        • app/backend/approaches/promptmanager.py: Manages loading and rendering of Jinja2 prompt templates
        • app/backend/approaches/prompts/query_rewrite.system.jinja2: Jinja2 template used to rewrite the query based off search history into a better search query
        • app/backend/approaches/prompts/chat_query_rewrite_tools.json: Tools used by the query rewriting prompt
        • app/backend/approaches/prompts/chat_answer.system.jinja2: Jinja2 template for the system message used by the Chat approach to answer questions
        • app/backend/approaches/prompts/chat_answer.user.jinja2: Jinja2 template for the user message used by the Chat approach, including sources
      • app/backend/prepdocslib: Contains the document ingestion library used by both local and cloud ingestion
        • app/backend/prepdocslib/blobmanager.py: Manages uploads to Azure Blob Storage
        • app/backend/prepdocslib/cloudingestionstrategy.py: Builds the Azure AI Search indexer and skillset for the cloud ingestion pipeline
        • app/backend/prepdocslib/csvparser.py: Parses CSV files
        • app/backend/prepdocslib/embeddings.py: Generates embeddings for text and images using Azure OpenAI
        • app/backend/prepdocslib/figureprocessor.py: Generates figure descriptions for both local ingestion and the cloud figure-processor skill
        • app/backend/prepdocslib/fileprocessor.py: Orchestrates parsing and chunking of individual files
        • app/backend/prepdocslib/filestrategy.py: Strategy for uploading and indexing files (local ingestion)
        • app/backend/prepdocslib/htmlparser.py: Parses HTML files
        • app/backend/prepdocslib/integratedvectorizerstrategy.py: Strategy using Azure AI Search integrated vectorization
        • app/backend/prepdocslib/jsonparser.py: Parses JSON files
        • app/backend/prepdocslib/listfilestrategy.py: Lists files from local filesystem or Azure Data Lake
        • app/backend/prepdocslib/mediadescriber.py: Interfaces for describing images (Azure OpenAI GPT-4o, Content Understanding)
        • app/backend/prepdocslib/page.py: Data classes for pages, images, and chunks
        • app/backend/prepdocslib/parser.py: Base parser interface
        • app/backend/prepdocslib/pdfparser.py: Parses PDFs using Azure Document Intelligence or local parser
        • app/backend/prepdocslib/searchmanager.py: Manages Azure AI Search index creation and updates
        • app/backend/prepdocslib/servicesetup.py: Shared service setup helpers for OpenAI, embeddings, blob storage, etc.
        • app/backend/prepdocslib/strategy.py: Base strategy interface for document ingestion
        • app/backend/prepdocslib/textparser.py: Parses plain text and markdown files
        • app/backend/prepdocslib/textprocessor.py: Processes text chunks for cloud ingestion (merges figures, generates embeddings)
        • app/backend/prepdocslib/textsplitter.py: Splits text into chunks using different strategies
      • app/backend/app.py: The main entry point for the backend application.
    • app/functions: Azure Functions used for cloud ingestion custom skills (document extraction, figure processing, text processing). Each function bundles a synchronized copy of prepdocslib; run python scripts/copy_prepdocslib.py to refresh the local copies if you modify the library.
    • app/frontend: Contains the React frontend code, built with TypeScript, built with vite.
      • app/frontend/src/api: Contains the API client code for communicating with the backend.
      • app/frontend/src/components: Contains the React components for the frontend.
      • app/frontend/src/locales: Contains the translation files for internationalization.
        • app/frontend/src/locales/da/translation.json: Danish translations
        • app/frontend/src/locales/en/translation.json: English translations
        • app/frontend/src/locales/es/translation.json: Spanish translations
        • app/frontend/src/locales/fr/translation.json: French translations
        • app/frontend/src/locales/it/translation.json: Italian translations
        • app/frontend/src/locales/ja/translation.json: Japanese translations
        • app/frontend/src/locales/nl/translation.json: Dutch translations
        • app/frontend/src/locales/ptBR/translation.json: Portuguese translations
        • app/frontend/src/locales/tr/translation.json: Turkish translations
      • app/frontend/src/pages: Contains the main pages of the application
  • infra: Contains the Bicep templates for provisioning Azure resources.
  • evals: Contains evaluation configs, datasets, and results.
    • evals/results: Contains raw per-run eval output folders. Use descriptive setup-based names for repeated runs, such as gpt54-low-top5-run1.
    • evals/results_summaries: Contains derived grouped summaries such as baseline.json and baseline.md.
    • evals/results_comparisons: Reserved for derived candidate-vs-baseline comparison artifacts.
    • evals/eval_compare.py: Compares eval result folders and reports averages, confidence intervals, and paired significance tests.
  • tests: Contains the test code, including e2e tests, app integration tests, and unit tests.

Read the full file on GitHub · 402 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 402 lines · 5,202 tokens per session scan A 8a07c8d52a94

Subscribe to this mod's changes

azure-search-openai-demo AGENTS.md is an instructions file published in the GitHub repository Azure-Samples/azure-search-openai-demo (7,803 stars, last pushed yesterday), licensed MIT. It adds 5,202 tokens to every session, about $0.0208 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

azure-search-openai-demo AGENTS.md compared with instructions from other repositories

azure-search-openai-demo AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
azure-search-openai-demo AGENTS.mdAzure-Samples/azure-search-openai-demoInstructions file7.8kyesterdayMITA5,202Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode