agentleFS
dirmacsdirmacs/daedra/AGENTS.md

daedra

AGENTS.md16 starsChanged 3 months agoMITView on GitHub

Daedra is a web search MCP server. It gives search and fetch tools to AI agents via MCP (Model Context Protocol). Fourteen unkeyed backends run in a fallback chain. Circuit breakers and per-backend rate limits keep search reliable from any IP.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 1 is common, 0 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run cargo test before you change any file.

    line 9
  2. Common:

    Do not hardcode paths or API keys in source code.

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

daedra — Agent Guidelines

What this is

Daedra is a web search MCP server. It gives search and fetch tools to AI agents via MCP (Model Context Protocol). Fourteen unkeyed backends run in a fallback chain. Circuit breakers and per-backend rate limits keep search reliable from any IP.

Rules for agents

  • Run cargo test before you change any file. All tests must pass.
  • The fallback chain is the core value. Do not change the backend order in SearchProvider::auto() without a good reason.
  • Each backend is independent. A new backend must not change the behavior of other backends.
  • The MCP server registers tools in src/server.rs (DaedraHandler::list_tools). The handlers are handle_web_search, handle_visit_page, and handle_crawl_site.
  • Tool names: web_search (primary), search_duckduckgo (backward-compatibility alias), visit_page, crawl_site.
  • The cache layer is transparent. Backends do not know that the cache exists.
  • Do not hardcode paths or API keys in source code. All configuration comes from environment variables or CLI arguments.

Module map

PathRole
src/main.rsCLI entry — Commands::run, CheckReporter for daedra check
src/server.rsMCP server, transports, DaedraHandler tool dispatch
src/lib.rsCrate root, re-exports
src/url_classification.rsData-driven URL → ContentType rules for search results
src/tools/backend.rsSearchProvider, BackendHealth circuit breakers, governor keyed limiters, classified retry, aggregate failure messages
src/tools/rss.rsMachine-format backends: Bing RSS, Google News RSS, HN Algolia
src/tools/soft_block.rsZero-result page classifier: genuine no-results or soft block
src/tools/fetch.rsFetchClient, FetchedContent (Html/Pdf/Document/Text/Binary), dom_smoothie, infer, pdf-inspector, anydoc
src/tools/crawl.rsSite crawl (sitemap + link following)
src/tools/bing.rs, src/tools/google.rsHTML scraper backends
src/tools/*.rsOther individual search backends
src/cache.rsmoka async cache layer
src/types.rsShared types; detect_language / detect_topics use data-driven tables

Reliability — do not regress

  • Circuit breaker: BackendHealth opens after 3 consecutive failures, with a 30 second cooldown per backend name.
  • Rate limits: BackendRateLimiters — separate keyed quotas for API, knowledge, and scraper backends.
  • Classified retry: transient backend errors get one retry after a 400 ms pause. Bot protection, 403, CAPTCHA, and rate-limit errors do not retry.
  • Aggregate failures: the error message names each failed backend with its error, and each backend that returned a true empty result. Do not merge these two cases into one message.
  • Soft blocks: a scraper page with HTTP 200 and zero results is a soft block (an error), not an empty result. The classifier in src/tools/soft_block.rs decides.
  • Fetch retry: fetch_with_retry and the DDG search use inline exponential backoff (400 ms to 2 s inside a 60 s window). The crate backoff is removed; do not re-add it (unmaintained).

Fetch and extraction

  • HTML: dom_smoothie Readability when no CSS selector is given. The selector path uses scraper and htmd.
  • PDF: infer detects application/pdf. pdf-inspector extracts Markdown. Office documents: anydoc converts to Markdown.
  • Unknown binary: FetchedContent::Binary returns a clear extraction error.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.