haystack AGENTS.md

A set of instructions for AI agents working in the deepset-ai/haystack repository. It explains the Hatch-based development environment, testing commands, type checking, and dependency practices.

In plain words
What is it for?
Setting up and using Haystack's development environment, running unit or integration tests, checking types, and installing temporary experiment dependencies.
Why use it?
It gives agents the repository's required way to run code and tests, helping avoid unsupported commands or incorrectly configured environments.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/deepset-ai/haystack/agents-md
Clone the repo
git clone --depth 1 https://github.com/deepset-ai/haystack

Made for: Codex, OpenCode.

Per session 412 This file is loaded in full into every session.
When invoked 412 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00412 $0.00412
Opus 5 $0.00206 $0.00206
Sonnet 5 $0.00082 $0.00082
Haiku 4.5 $0.00041 $0.00041

Measured 2d ago against content hash 95839b791fe9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

haystack AGENTS.md scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 62 lines

What it actually says

Haystack Guidelines for AI Agents

Environment

Haystack uses Hatch for environment and dependency management.

Do not run python or pip directly.

Before running code on this project, you must be able to run hatch --version and get a correct output.

If not, ask the user where Hatch is or if they want to install it. For installation instructions, refer to https://hatch.pypa.io/latest/install/#installation.

Run scripts with test dependencies

hatch -e test run python SCRIPT.py

Open a shell with test dependencies

hatch -e test shell

Install temporary dependencies (for experiments only)

uv pip install PACKAGE

Delete the environment

hatch env prune

Tests

Tests run via Hatch and support pytest arguments.

Prefer running tests on a specific module or using -k, since the full suite is large.

Run unit tests

hatch run test:unit

Run integration tests

hatch run test:integration

Quality Checks

Type checking with mypy

hatch run test:types

Type checking targets Python 3.12, above the 3.10 floor in requires-python, because numpy's stubs use PEP 695 type statements that mypy rejects below 3.12. So mypy will not catch code that breaks on 3.10; the unit test matrix runs on 3.10 and covers that.

To fix type issues, avoid type: ignore, casts, or assertions when possible. If they are necessary, explain why.

Format and lint

hatch run fmt

Release Notes

Every user-facing PR (not docs, not CI) must include a release note:

hatch run release-note SHORT_DESCRIPTION

Edit the generated file in releasenotes/notes/. Release notes use reStructuredText formatting; see the release notes section in CONTRIBUTING.md for details.

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. 2d ago First seen · 62 lines · 412 tokens per session scan A 95839b791fe9

Subscribe to this mod's changes

haystack AGENTS.md is an instructions file published in the GitHub repository deepset-ai/haystack (26,366 stars, last pushed 2d ago), licensed Apache-2.0. It adds 412 tokens to every session, about $0.0021 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.