dingo
AGENTS.md757 starsChanged 7 months agoApache-2.0View on GitHub
Dingo is a comprehensive AI data quality evaluation tool for ML practitioners, data engineers, and AI researchers. It systematically assesses training data, fine-tuning datasets, and production AI systems using rule-based, LLM-based, and agent-based evaluation methods. Repository: https://github.com/MigoXLab/dingo PyPI: pip install dingo-python License: Apache 2.0
- Reads credentials
- Installs packages
We split this AGENTS.md into the rules it gives an agent
14 rules. About 1 is common, 6 are distinctive, and 7 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 99
All evaluators use decorator-based registration:
- Very specific: line 193
All evaluators must return EvalDetail with metric, status, label, reason
- Distinctive: line 194
Use lazy imports for optional heavy dependencies (torch, transformers, pyarrow, etc.)
- Common: line 195
Never hardcode API keys; use environment variables or config parameters
- Very specific: line 199
Create class in dingo/model/rule/rule_common.py (or a new file under dingo/model/rule/)
- Very specific: line 207
Create class in dingo/model/llm/ (appropriate subdirectory)
- Very specific: line 215
Create datasource class in dingo/data/datasource/
- Very specific: line 216
Create dataset class in dingo/data/dataset/
- Distinctive: line 218
Use lazy imports if new dependencies required
- Very specific: line 219
Add dependency to requirements/runtime.txt (core) or setup.py extras (heavy/optional)
- Distinctive: line 273
Follow semantic versioning (MAJOR.MINOR.PATCH)
- Very specific: line 277
Start via CLI: dingo serve (SSE default) or dingo serve --transport stdio Legacy entry point: mcp_server.py Framework: FastMCP
- Distinctive: line 304
When these events occur, update the corresponding files:
- Distinctive: line 317
After completing a feature, check if any of the above need updating.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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.
Files
Dingo — Agent Instructions
Project Overview
Dingo is a comprehensive AI data quality evaluation tool for ML practitioners, data engineers, and AI researchers. It systematically assesses training data, fine-tuning datasets, and production AI systems using rule-based, LLM-based, and agent-based evaluation methods.
Repository: https://github.com/MigoXLab/dingo
PyPI: pip install dingo-python
License: Apache 2.0
Tech Stack
| Layer | Technology |
| Language | Python 3.10+ |
| Data Models | Pydantic (BaseModel, extra="allow") |
| LLM Integration | OpenAI SDK (supports any compatible API) |
| MCP Server | FastMCP + SSE transport |
| Distributed | PySpark (optional) |
Directory Structure
dingo/
├── AGENTS.md ← this file (agent instructions)
├── setup.py ← package config (extras_require for optional deps)
├── mcp_server.py ← MCP server entry point (legacy, use `dingo serve` instead)
├── requirements/
│ ├── runtime.txt ← core dependencies (minimal)
│ ├── datasource.txt ← optional datasource deps (S3, SQL, Parquet, etc.)
│ ├── optional.txt ← heavy optional deps (torch, pyspark, etc.)
│ └── agent.txt ← agent evaluation deps (langchain, tavily)
│
├── SKILL.md ← AI agent skill definition (symlink → clawhub/SKILL.md)
├── dingo/ ← core Python package
│ ├── config/
│ │ └── input_args.py ← InputArgs, EvalPiplineConfig, EvaluatorGroupConfig
│ ├── io/
│ │ ├── input/data.py ← Data model (Pydantic, extra="allow")
│ │ └── output/ ← ResultInfo, EvalDetail, SummaryModel, BenchmarkReport
│ │ └── benchmark_report.py ← Multi-system/dataset comparison & aggregation
│ ├── data/
│ │ ├── datasource/ ← LocalDataSource, SQLDataSource, S3DataSource, HFDataSource
│ │ ├── dataset/ ← Dataset implementations per source
│ │ ├── searcher.py ← Searcher protocol + SearchResult + registry (mock, ES)
│ │ └── converter/ ← Format converters (JSON, JSONL, CSV, Parquet, MinerU, etc.)
│ ├── model/
│ │ ├── model.py ← Model registry (rule_register, llm_register)
│ │ ├── rule/ ← Rule-based evaluators (80+ built-in)
│ │ │ ├── base.py ← BaseRule
│ │ │ ├── rule_common.py ← Common rules (text quality, format, PII, etc.)
│ │ │ ├── guobiao/
│ │ │ │ └── rule_tc609_quality.py ← TC609 quality metrics and placeholders
│ │ │ ├── rule_search_ranking.py ← IR ranking metrics (NDCG, MRR, Recall, Precision, MAP, HitRate)
│ │ │ └── utils/ ← Shared utilities (normalize, ngrams, etc.)
│ │ └── llm/ ← LLM-based evaluators
│ │ ├── base_openai.py ← BaseOpenAI (base class for all LLM evaluators)
│ │ ├── text_quality/ ← Text quality evaluators (V4, V5)
│ │ ├── rag/ ← RAG metrics (Faithfulness, Precision, Recall, etc.)
│ │ ├── llm_search_result_relevance.py ← Search result relevance (Exa-style pointwise)
│ │ ├── hhh/ ← 3H evaluators (Honest, Helpful, Harmless)
│ │ ├── compare/ ← Document comparison evaluators
│ │ └── agent/ ← Agent-based evaluators
│ │ ├── base_agent.py ← BaseAgent
│ │ ├── tools/ ← Tool registry + implementations
│ │ ├── agent_fact_check.py
│ │ └── agent_hallucination.py
│ ├── exec/
│ │ ├── local.py ← LocalExecutor (single machine, cross-layer conflict detection)
│ │ ├── spark.py ← SparkExecutor (distributed)
│ │ └── retrieval.py ← RetrievalExecutor (MTEB retrieval benchmarks)
│ ├── retrieval/ ← Retrieval evaluation module
│ │ ├── search_client.py ← SearchClient ABC + registry + PaperResult/SearchResponse
│ │ ├── backends/
│ │ │ └── agentic.py ← AgenticSearchClient (local + public mode)
│ │ ├── mteb_adapter.py ← SearchClientModel (MTEB SearchProtocol adapter)
│ │ └── eval_utils.py ← normalize_title, resolve_hit, save_json
│ └── run/
│ └── cli.py ← CLI entry point (subcommands: eval, eval-retrieval, info, serve)
│
├── examples/ ← Usage examples (SDK, CLI, various scenarios)
├── test/ ← Test suite
│ ├── data/ ← Test data files
│ ├── env/ ← Test environment configs
│ └── scripts/ ← Test scripts (pytest)
└── docs/ ← DocumentationCore Concepts
Data Flow
Data Input → Interface (SDK/CLI/MCP) → Datasource → Dataset → Converter → Evaluator → Executor → ReportRegistration System
All evaluators use decorator-based registration:
# Rule evaluator
@Model.rule_register('QUALITY_BAD_COMPLETENESS', ['default', 'pretrain'])
class MyRule(BaseRule):
@classmethod
def eval(cls, input_data: Data) -> EvalDetail: ...
# LLM evaluator
@Model.llm_register('MyLLMEvaluator')
class MyLLMEvaluator(BaseOpenAI):
prompt = "..."
@classmethod
def build_messages(cls, input_data: Data) -> List: ...
# Agent evaluator
@Model.llm_register('MyAgent')
class MyAgent(BaseAgent):
available_tools = ["tavily_search"]
@classmethod
def eval(cls, input_data: Data) -> EvalDetail: ...Data Model
Data uses extra = "allow" — any field can be set dynamically:
class Data(BaseModel):
class Config:
extra = "allow"Common fields: data_id, prompt, content, image, context, raw_data, reference, user_input, response, retrieved_contexts.
InputArgs Configuration
input_data = {
"input_path": "data.jsonl",
"dataset": {"source": "local", "format": "jsonl"},
"executor": {"max_workers": 4, "batch_size": 10, "result_save": {"bad": True, "good": True}},
"evaluator": [
{
"fields": {"content": "text_field", "prompt": "question_field"},
"evals": [
{"name": "RuleAbnormalChar"},
{"name": "LLMTextQualityV5", "config": {"key": "...", "model": "gpt-4o", "api_url": "..."}}
]
}
]
}Supported Data Formats
| Format | dataset.format | Description |
| JSON | json | Top-level array, each element is one sample |
| JSONL | jsonl | One JSON object per line |
| CSV | csv | Comma-separated values with header |
| Parquet | parquet | Apache Parquet columnar format |
| Plain text | plaintext | One line per sample, mapped to content |
| List JSON | listjson | Top-level {key: [...]} structure |
| MinerU V1 | mineru | MinerU content_list.json (flat block array) |
| MinerU V2 | mineru_v2 | MinerU content_list_v2.json (pages × blocks) |
MinerU formats automatically flatten blocks into Data objects, preserving all original fields (type, bbox, page_idx, etc.) via Pydantic extra="allow". Use dataset.mineru_config.include_types to filter by block type.
Execution Modes
| Mode | Class | Use Case |
| Local | Executor.exec_map["local"] | Development, < 100K rows |
| Spark | Executor.exec_map["spark"] | Production, > 1M rows |
| Retrieval | Executor.exec_map["retrieval"] | Search API benchmark evaluation (MTEB) |
Optional Dependencies (extras_require)
pip install dingo-python # Core (includes all datasource support)
pip install "dingo-python[hhem]" # + HHEM hallucination detection (transformers + torch)
pip install "dingo-python[agent]" # + Agent-based evaluation (langchain)
pip install "dingo-python[retrieval]" # + Retrieval benchmark evaluation (mteb, tqdm)
pip install "dingo-python[all]" # + EverythingDevelopment Conventions
General
- Python 3.10+ required
- Code comments in English or Chinese (both acceptable)
- All evaluators must return
EvalDetailwithmetric,status,label,reason - Use lazy imports for optional heavy dependencies (torch, transformers, pyarrow, etc.)
- Never hardcode API keys; use environment variables or config parameters
Adding a New Rule Evaluator
- Create class in
dingo/model/rule/rule_common.py(or a new file underdingo/model/rule/) - Inherit from
BaseRule - Decorate with
@Model.rule_register(metric_type, groups) - Implement
eval(cls, input_data: Data) -> EvalDetailas classmethod - Set
_required_fieldsto declare needed input fields
Adding a New LLM Evaluator
- Create class in
dingo/model/llm/(appropriate subdirectory) - Inherit from
BaseOpenAI - Decorate with
@Model.llm_register('EvaluatorName') - Set
promptattribute or overridebuild_messages() - Override
parse_result()if custom response parsing needed
Adding a New Datasource
- Create datasource class in
dingo/data/datasource/ - Create dataset class in
dingo/data/dataset/ - Register in the respective
__init__.py - Use lazy imports if new dependencies required
- Add dependency to
requirements/runtime.txt(core) orsetup.pyextras (heavy/optional)
Testing
# Run all tests
pytest test/scripts --ignore=test/scripts/data
# Run specific test
pytest test/scripts/model/llm/test_rag.py -v
# Integration tests (CLI)
dingo eval --input .github/env/local_plaintext.json
dingo eval --input .github/env/local_json.json --jsonCLI Reference
Dingo provides a dingo CLI command (installed via pip install dingo-python):
# Run evaluation (primary command)
dingo eval --input config.json # Human-readable output
dingo eval --input config.json --json # JSON output (for agents/automation)
# Run retrieval benchmark evaluation
dingo eval-retrieval --backend agentic --tasks SciFact \
--api-url https://api.sciverse.space --api-token <token> --limit 100
dingo eval-retrieval --tasks SciFact LitSearch --max-queries 50 --max-workers 4 \
--api-url http://localhost:8080
# List available evaluators, groups
dingo info # Show all (rules, LLM, groups)
dingo info --rules # Rule evaluators only
dingo info --llm # LLM evaluators only
dingo info --groups # Rule groups only
dingo info --json # JSON output
dingo info --count # Metric counts only (rules / llm / groups / total_metrics)
dingo info --json --count # JSON with top-level "counts" plus full lists
# Start MCP server (for AI agent integration)
dingo serve # SSE transport on 0.0.0.0:8000
dingo serve --port 9000 # Custom port
dingo serve --transport stdio # stdio transport (for local agent)
# Backward compatibility (no subcommand)
dingo --input config.json # Same as `dingo eval --input config.json`
python -m dingo.run.cli --input config.jsonVersion Conventions
- Version defined in
setup.py(version="2.0.0") - Follow semantic versioning (MAJOR.MINOR.PATCH)
MCP Server
Start via CLI: dingo serve (SSE default) or dingo serve --transport stdio
Legacy entry point: mcp_server.py
Framework: FastMCP
Available MCP Tools
| Tool | Purpose |
run_dingo_evaluation | Run rule or LLM evaluation on a file |
list_dingo_components | List rule groups, LLM models, prompts |
get_rule_details | Get details about a specific rule |
get_llm_details | Get details about a specific LLM evaluator |
get_prompt_details | Get embedded prompt for an LLM |
run_quick_evaluation | Goal-based evaluation (auto-infer settings) |
MCP Environment Variables
| Variable | Purpose |
OPENAI_API_KEY | OpenAI API key for LLM evaluation |
OPENAI_BASE_URL | Custom API base URL |
OPENAI_MODEL | Model name (default: gpt-4) |
DEFAULT_OUTPUT_DIR | Default output directory |
LOG_LEVEL | Logging level (default: info) |
Config Maintenance Rules
When these events occur, update the corresponding files:
| Event | Update |
| New evaluator added | Ensure registration decorator is correct; update docs/metrics.md |
| New datasource added | Update requirements/runtime.txt, setup.py extras if heavy, README install section |
| New dependency added | Decide: runtime.txt (core) vs setup.py extras (heavy/optional); use lazy import for optional |
| New MCP tool added | Update MCP Tools table in this file |
| New CLI subcommand added | Update CLI Reference section in this file |
| New search backend added | Add to dingo/retrieval/backends/, register with @register_backend |
| Directory structure change | Update this file |
| Version bump | Update setup.py version field |
After completing a feature, check if any of the above need updating.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 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 repository7 other files it gives its agents.
- .cursor/rules/evaluator-development.mdcCursor rule
- .cursor/rules/project-architecture.mdcCursor rule
- .cursor/rules/python-conventions.mdcCursor rule
- dingo-verifySkill
- clawhubSkill
- SKILL.mdSkill
- dingo-verifySkill
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
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.

