{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "birfy-agentdescent--evolve-a-prompt-against-your-own-examples",
 "repo": "Birfy/agentdescent",
 "repo_url": "https://github.com/Birfy/agentdescent",
 "repo_slug": "birfy-agentdescent",
 "title": "Evolve a prompt against your own labeled examples",
 "page_title": "How to evolve a prompt against your own labeled examples with Agentdescent",
 "summary": "Point the evolve call at your question and answer rows to get an improved prompt.",
 "who": "An AI engineer with a set of question and answer pairs who needs a better system prompt for a model they already call through an OpenAI-compatible endpoint.",
 "problem": "Hand-tuning a prompt against examples is slow, and it is hard to tell which edit actually helped.",
 "outcome": "An evolved prompt printed with its held-out reward, scored on examples the loop did not train on.",
 "steps": [
  "`pip install \"agentdescent>=0.7.0\"`",
  "`export OPENAI_BASE_URL=https://api.deepseek.com` (or your own endpoint, such as a local vLLM)",
  "`export OPENAI_API_KEY=sk-...` (your key for that endpoint)",
  "Write a Python script that builds tasks with `tasks_from(rows, prompt=\"question\", gold=\"answer\")`, then calls `evolve(tasks, scorer(\"exact\"), run=run, propose=reflector(model), strategy=SingleSlot(initial_value=\"You are a helpful assistant.\"), rounds=8, n_workers=8, max_concurrency=8, held_out_frac=0.3, patience=3, target_reward=0.98)`. (inferred, check the README)",
  "Run the script and read `result.rendered`, `result.final_reward`, and `result.outcomes()`."
 ],
 "agent_prompt": "In the AgentDescent repo, build a script that loads <path to your CSV of question and answer rows> into tasks and runs evolve with SingleSlot and exact scoring. Expected output: the evolved prompt, the held-out reward, and the outcomes list. Verify that the held-out reward is reported separately from training results.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The README's worked example uses the HotpotQA dataset and a DeepSeek model, and its reported gain is for that setup only.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.9 or newer",
  "pip to install the agentdescent package from PyPI",
  "For model-backed runs: an OpenAI-compatible endpoint, its base URL, and an API key set in environment variables (OPENAI_BASE_URL and OPENAI_API_KEY)",
  "For agent-plugin use: Claude Code or Codex installed, and git to clone the repo"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The API key is read from the environment, so keep it out of the script and out of any committed file."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/birfy-agentdescent/evolve-a-prompt-against-your-own-examples/",
 "md": "https://dedupedai.com/use-cases/birfy-agentdescent/evolve-a-prompt-against-your-own-examples/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/birfy-agentdescent--evolve-a-prompt-against-your-own-examples.json",
 "api_version": "v1"
}
