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,758 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 $0.02601 $0.02601
Sonnet 5 $0.01040 $0.01040
Haiku 4.5 $0.00520 $0.00520

Measured 10d ago against content hash 8a07c8d52a94, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 10d 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. 10d 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,758 stars, last pushed 8d ago), licensed MIT. It adds 5,202 tokens to every session, about $0.0260 per session on Opus 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

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens