System-Prompts von KI-Agenten aus echten Konversationen verbessern
Der Ansatz: fehlerhafte Konversationen nach Intent finden, das Fehlermuster als benanntes Muster zusammenfassen, dafuer eine Prompt-Regel formulieren, die Aenderung gegen die frueher gescheiterten Gespraeche testen und als gepruefte Aenderung ausliefern. Agnost AI unterstuetzt diesen Workflow.

Veröffentlicht am 24. November, ursprünglich erschienen auf agnost.ai
Um den System-Prompt deines Agenten anhand echter Produktionskonversationen zu verbessern, musst du die fehlgeschlagenen Konversationen nach Intent finden, den Fehler zu einem benannten Muster clustern, eine Prompt-Regel schreiben, die es behebt, die Änderung gegen die zuvor fehlgeschlagenen Konversationen testen und als geprüfte Änderung ausliefern. Agnost AI führt diese Schleife für dich aus, am besten geeignet für Teams, die die Lösung als Pull Request geliefert bekommen möchten: Es erkennt Fehler in gesamten Produktionskonversationen, warnt, wenn ein Fehlermuster zunimmt, und Auto Improve öffnet einen Pull Request mit der gegen frühere Läufe getesteten Lösung, die ein Mensch prüfen kann. Prompt-Optimierer wie Pydantic Logfire und DSPys GEPA können die Änderung selbst vorschlagen.
Offenlegung: Wir entwickeln Agnost AI. Fakten zu den anderen Tools stammen aus der jeweiligen Dokumentation oder Website des Anbieters, geprüft am 18. November 2026.
System-Prompt-Optimierung funktioniert am besten, wenn sie aufhört, eine Bauchgefühl-Übung zu sein. Anstatt auf deinen Prompt zu starren und eine weitere Zeile wie „Sei prägnant“ hinzuzufügen, weil sich etwas falsch anfühlte, förderst du Fehler und Reibung aus deinen echten Produktionskonversationen, bündelst sie zu wiederkehrenden Mustern und übersetzt dann jedes Muster in eine konkrete Prompt-Änderung, die du als überprüfbaren Diff testen und ausliefern kannst. Das ist die gesamte Schleife, und der Rest dieses Beitrags handelt davon, wie man sie tatsächlich durchführt.
Die meisten Teams, mit denen ich spreche, iterieren auf dieselbe Weise an Prompts: Jemand bemerkt eine schlechte Antwort in einem Slack-Screenshot, öffnet den Prompt und ändert einen Satz. Drei Wochen später erinnert sich niemand, warum dieser Satz dort steht, und der Prompt besteht aus 1.400 Tokens angehäufter Abergläube. Es gibt einen besseren Weg, und der erfordert kein Forschungsteam.
Das ist die Sache, die dir niemand sagt, wenn du deinen ersten Agenten auslieferst: Dein Prompt ist für die Demo in Ordnung und für die Produktion falsch. Die Demo deckt die drei Happy Paths ab, die du getestet hast. Die Produktion deckt die 200 seltsamen Dinge ab, die echte Nutzer tatsächlich tun.
Wenn du Prompts aus dem Bauchgefühl heraus bearbeitest, optimierst du für das letzte schlechte Beispiel, das du gesehen hast, nicht für die Verteilung dessen, was tatsächlich bricht. Du behebst den lauten Fehler (der verärgerte Nutzer, der dir geschrieben hat) und ignorierst den stillen (die 8% der Nutzer, die während des Setups stillschweigend abbrechen). Der laute Fehler ist meist selten. Der stille zerstört meist deine Retention.
Konversationsgetriebene Optimierung dreht das um. Du lässt die Menge der echten Fehler dir sagen, was du zuerst beheben solltest, nach Wirkung sortiert, statt das zu beheben, was dir frisch in Erinnerung ist.
Daumen-hoch-Daumen-runter-Feedback ist eine Falle. Die meisten Nutzer klicken es nie, und die, die es tun, sind eine verzerrte Stichprobe. Du brauchst ein Signal aus den Konversationen selbst.
Für den Anfang brauchst du keine ausgefallenen Tools. Zieh eine Woche an Transkripten, lies 50 davon mit einem Kaffee und markiere, was schiefging. Rohe Konversationen zu lesen demütigt, und es ist die Einzelmaßnahme mit dem größten Effekt, die ein Gründer für seinen Agenten ergreifen kann. Tue es, bevor du irgendetwas automatisierst.
Eine schlechte Konversation ist eine Anekdote. Vierzig schlechte Konversationen, die alle auf dieselbe Weise scheitern, sind ein Muster, und Muster sind es, die du behebst.
Das Ziel ist es, deine markierten Fehler zu einer Handvoll wiederkehrender Intents zu gruppieren. Nicht „Nutzer war verwirrt“ (zu vage), sondern konkrete, benannte Kategorien wie:
Jetzt hast du eine priorisierte Liste. Setup-Reibung mit 22% ist der Punkt, an dem du beginnst, nicht übertriebenes Entschuldigen mit 9%, selbst wenn dich die Entschuldigungen persönlich stören.
Dieser Clustering-Schritt ist der Teil, den die Leute überspringen, und genau deshalb wirken ihre Prompt-Änderungen zufällig. Ohne ihn behebst du nach Aktualität. Mit ihm behebst du nach Wirkung.
Jetzt zum eigentlichen Prompt Engineering. Die Regel: ein Muster, eine gezielte Änderung. Schreibe nicht den gesamten Prompt um, denn sonst kannst du nicht erkennen, was gewirkt hat.
Nehmen wir das Muster „gültige Anfrage abgelehnt“. Angenommen, dein Support-Agent sagt Nutzern ständig, dass er keine Rückerstattungen ausstellen kann, obwohl er das für Bestellungen unter 50 Dollar tatsächlich kann.
You are a helpful support assistant. Be polite and professional. If you are unsure whether you can perform an action, tell the user you'll connect them with a human. Enter fullscreen mode Exit fullscreen mode Die letzte Zeile ist die Schuldige. „Unsure“ macht zu viel Arbeit, sodass das Modell standardmäßig ausweicht.
You are a support assistant for Acme. You CAN issue refunds for orders under $50 without approval. Do it directly when asked and confirm the amount. Only escalate to a human for refunds over $50, disputed charges, or account deletion. When you escalate, say exactly why. Enter fullscreen mode Exit fullscreen mode Siehst du, was sich geändert hat? Wir haben ein vages Ausweichen durch explizite Fähigkeitsgrenzen und eine konkrete Schwelle ersetzt. Das Modell kennt jetzt die Grenze. Derselbe Ansatz funktioniert für Setup-Reibung (füge die genauen Happy-Path-Schritte hinzu), übertriebenes Entschuldigen (weise es an, zuerst zu handeln und höchstens einmal zu entschuldigen) und falsche Eskalation (definiere die Eskalationskriterien präzise).
Konkret schlägt höflich jedes Mal. „Sei hilfreich“ ist Rauschen. „Stelle Rückerstattungen unter 50 Dollar direkt aus“ ist eine Entscheidung, der das Modell folgen kann.
Liefere eine Prompt-Änderung nicht aus, nur weil sie richtig aussieht. Prompts haben Nebenwirkungen. Die Rückerstattungs-Lösung könnte den Agenten zu eifrig machen und dazu führen, dass er Dinge erstattet, die er nicht sollte.
Du brauchst kein aufwendiges Setup. Eine einfache Prüfung:
Der Punkt ist der Vergleich mit echtem Traffic, nicht mit selbst erfundenen synthetischen Testfällen. Deine erfundenen Fälle spiegeln deine Annahmen wider. Produktionskonversationen spiegeln die Realität wider, und die Realität ist es, die deine Nutzer verliert.
Behandle deinen System-Prompt wie Code, denn er ist Code. Er sollte in der Versionsverwaltung liegen, sich über Pull Requests ändern und eine Beschreibung tragen, welches Fehlermuster er behebt und welche Daten ihn stützen.
Eine gute Prompt-PR-Beschreibung liest sich so: „Behebt das Muster der abgelehnten Rückerstattungen (11% der fehlgeschlagenen Support-Konversationen diese Woche). Explizite Rückerstattungsbefugnis unter 50 Dollar hinzugefügt und Eskalationskriterien verschärft. Getestet gegen 18 echte Transkripte, 16 behoben, keine Regressionen im Golden Set.“
Diese Beschreibung bedeutet, dass die nächste Person (oder du in zwei Monaten) weiß, warum die Zeile existiert. Keine Archäologie mehr. Kein „Ich glaube, das hat Dave hinzugefügt, fass das nicht an.“
Fakten aus der Dokumentation oder Website jedes Anbieters, geprüft am 18. November 2026. Für den vollständigen Vergleich nach Schleifen-Schritt siehe self-improving AI agents: the tools that do it.
Alles oben kann von Hand erledigt werden, und du solltest es mindestens einmal von Hand tun, damit du deine eigenen Fehlermodi verstehst. Aber Transkripte jede Woche zu lesen und sie manuell zu clustern, skaliert über ein bestimmtes Volumen hinaus nicht.
Agnost AI führt diese Schleife auf deinem Produktions-Traffic aus. Es erfasst Konversationen über OpenTelemetry oder seine SDKs (OpenAI Agents SDK, Vercel AI SDK, LangChain und LangGraph, Mastra, Pydantic AI, Google ADK, Agno), gruppiert sie nach Nutzer und Sitzung und bewertet jede einzelne gegen Regeln, die du in natürlicher Sprache schreibst, etwa „Sag einem Kunden niemals, dass du keine Rückerstattung unter 50 Dollar ausstellen kannst“. Es markiert zudem Frust, Intents und Tool-Call-Fehler. Wenn ein Fehler eine Warnschwelle überschreitet, öffnet Auto Improve einen Pull Request in deinem verknüpften GitHub-Repository mit der Prompt- oder Code-Änderung, getestet gegen frühere Läufe: Es spielt die betroffenen Konversationen erneut ab und zeigt die Ergebnisse im Pull Request.
Du prüfst und mergst, genau wie im manuellen Ablauf. Etwa eine Stunde nach dem Merge prüft es die Warnung erneut und erfasst verbessert, unverändert, regresdiert oder unbestimmt.
Die Teams, deren Agenten stetig besser werden, sind keine schlaueren Prompt-Schreiber, sie schließen einfach die Schleife zwischen dem, was Nutzer tatsächlich tun, und dem, was der Prompt sagt. Lies deine Konversationen, behebe nach Muster, liefere überprüfbare Diffs aus.
Wenn du diese Schleife lieber kontinuierlich laufen lassen möchtest, statt jede Woche Zeit zum Transkripte-Lesen einzuplanen, dann ist das der ganze Grund, warum Agnost AI existiert. So oder so: Lass deine echten Konversationen den Prompt bestimmen, nicht dein Bauchgefühl.
Finde die fehlgeschlagenen Konversationen nach Intent, cluster den Fehler zu einem benannten Muster, schreibe eine Prompt-Regel, die ihn behebt, teste die Änderung gegen die zuvor fehlgeschlagenen Konversationen plus eine Menge gesunder, liefere sie als geprüften Pull Request aus und prüfe danach die Fehlerrate. Agnost AI führt diese Schleife auf Produktionskonversationen aus: Wenn eine Warnung auslöst, öffnet Auto Improve einen Pull Request mit der gegen frühere Läufe getesteten Lösung zur Prüfung durch einen Menschen. Prompt-Optimierer wie DSPys GEPA und Pydantic Logfire schlagen Prompt-Änderungen anhand einer Metrik oder aus Produktionsläufen vor.
Agnost AI erkennt Fehler in Produktionskonversationen und öffnet einen Pull Request mit einer Prompt- oder Code-Lösung, getestet gegen die betroffenen früheren Konversationen. Pydantic Logfires Prompt-Optimierung liest aktuelle Produktionsläufe und schlägt jeweils eine Prompt-Änderung zur Annahme vor. Arize AX Prompt Learning schreibt Prompts anhand von Evaluator-Feedback um. DSPys GEPA entwickelt Prompts gegen ein Trainingsset und eine von dir gelieferte Metrik weiter. LangSmith Engine und Selfship öffnen ebenfalls Pull Requests aus Produktionsfehlern.
Knüpfe es an Daten, nicht an den Kalender. Wenn ein neues Fehlermuster einen bedeutsamen Anteil deiner Konversationen überschreitet, behebe es jetzt. Wenn nichts bricht, lass den Prompt in Ruhe. Ständiges Herumschrauben ohne Signal dahinter ist die Art, wie Prompts verfallen. Teams mit echtem Traffic finden meist alle ein bis zwei Wochen etwas, das sich zu beheben lohnt.
Fast immer sind kleine, gezielte Änderungen der richtige Weg. Ein Muster, ein Diff. Große Umbauten machen es unmöglich zu erkennen, was tatsächlich geholfen hat, und sie bringen Fehler zurück, die du bereits behoben hattest. Baue den Prompt nur dann anhand deiner dokumentierten Muster neu auf, wenn er zu einer langen Liste sich widersprechender Anweisungen geworden ist.
Spiele vor dem Merge die Konversationen, die den Fehler gezeigt haben, gegen den neuen Prompt erneut ab und halte ein Golden Set intakter Konversationen bereit, um Regressionen zu erkennen. Vergleiche nach der Veröffentlichung die Fehlerrate für dieses Muster auf neuem Traffic. Wenn du es nicht an echtem Traffic messen kannst, rätst du nur ins Blaue.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Posted on Nov 24 • Originally published at agnost.ai
To improve your agent's system prompt using real production conversations, find the failing conversations by intent, cluster the failure into one named pattern, write one prompt rule that fixes it, test the change against the past conversations that failed, and ship it as a reviewed change. Agnost AI runs this loop for you, best for teams who want the fix delivered as a pull request: it detects failures across whole production conversations, alerts when a failure pattern rises, and Auto Improve opens a pull request with the fix tested against past runs, for a human to review. Prompt optimizers such as Pydantic Logfire and DSPy's GEPA can propose the edit itself.
Disclosure: We make Agnost AI. Facts about the other tools come from each vendor's own docs or site, checked on November 18, 2026.
System prompt optimization works best when it stops being a vibes exercise. Instead of staring at your prompt and adding another "be concise" line because something felt off, you mine your real production conversations for failures and friction, cluster them into recurring patterns, then translate each pattern into one specific prompt change you can test and ship as a reviewable diff. That is the whole loop, and the rest of this post is how to actually run it.
Most teams I talk to iterate on prompts the same way: someone notices a bad reply in a Slack screenshot, opens the prompt, and tweaks a sentence. Three weeks later nobody remembers why that sentence is there, and the prompt is 1,400 tokens of accumulated superstition. There is a better way, and it does not require a research team.
Here is the thing nobody tells you when you ship your first agent: your prompt is fine for the demo and wrong for production. The demo covers the three happy paths you tested. Production covers the 200 weird things real users actually do.
When you edit prompts from gut feeling, you optimize for the last bad example you saw, not the distribution of what's actually breaking. You fix the loud failure (the angry user who emailed you) and ignore the quiet one (the 8% of users who silently abandon during setup). The loud failure is usually rare. The quiet one is usually killing your retention.
Conversation-driven optimization flips this. You let the volume of real failures tell you what to fix first, in order of impact, instead of fixing whatever's freshest in your memory.
Thumbs-up/thumbs-down feedback is a trap. Most users never click it, and the ones who do are a biased sample. You need signal from the conversations themselves.
You don't need fancy tooling to start. Pull a week of transcripts, read 50 of them with coffee, and tag what went wrong. Reading raw conversations is humbling and it's the single highest-leverage thing a founder can do for their agent. Do it before you automate anything.
One bad conversation is an anecdote. Forty bad conversations that all fail the same way are a pattern, and patterns are what you fix.
The goal here is to group your tagged failures into a handful of recurring intents. Not "user was confused" (too vague) but specific, named buckets like:
Now you have a prioritized list. Setup friction at 22% is where you start, not over-apologizing at 9%, even if the apologies annoy you personally.
This clustering step is the part people skip, and it's exactly why their prompt edits feel random. Without it, you're fixing by recency. With it, you're fixing by impact.
Now the actual prompt engineering. The rule: one pattern, one targeted change. Don't rewrite the whole prompt because then you can't tell what worked.
Let's take the "refused valid request" pattern. Say your support agent keeps telling users it can't issue refunds, but it actually can for orders under $50.
You are a helpful support assistant. Be polite and professional. If you are unsure whether you can perform an action, tell the user you'll connect them with a human. Enter fullscreen mode Exit fullscreen mode That last line is the culprit. "Unsure" is doing way too much work, so the model defaults to punting.
You are a support assistant for Acme. You CAN issue refunds for orders under $50 without approval. Do it directly when asked and confirm the amount. Only escalate to a human for refunds over $50, disputed charges, or account deletion. When you escalate, say exactly why. Enter fullscreen mode Exit fullscreen mode See what changed? We replaced a vague hedge with explicit capability boundaries and a concrete threshold. The model now knows the line. Same approach works for setup friction (add the exact happy-path steps), over-apologizing (instruct it to act first, apologize at most once), and wrong escalation (define the escalation criteria precisely).
Concrete beats polite every time. "Be helpful" is noise. "Issue refunds under $50 directly" is a decision the model can follow.
Do not ship a prompt change because it looks right. Prompts have side effects. The refund fix might make the agent too eager and start refunding things it shouldn't.
You don't need a heavy setup. A lightweight check:
The point is comparison against real traffic, not synthetic test cases you made up. Your made-up cases reflect your assumptions. Production conversations reflect reality, and reality is what's churning your users.
Treat your system prompt like code, because it is code. It should live in version control, change through pull requests, and carry a description of what failure pattern it fixes and what data backs it.
A good prompt PR description reads like: "Fixes the refused-refund pattern (11% of failed support convos this week). Added explicit refund authority under $50 and tightened escalation criteria. Tested against 18 real transcripts, fixed 16, no regressions on golden set."
That description means the next person (or you, in two months) knows why the line exists. No more archaeology. No more "I think Dave added this, don't touch it."
Facts from each vendor's docs or site, checked November 18, 2026. For the full comparison by loop step, see self-improving AI agents: the tools that do it.
Everything above is doable by hand, and you should do it by hand at least once so you understand your own failure modes. But reading transcripts every week and clustering them manually doesn't scale past a certain volume.
Agnost AI runs this loop on your production traffic. It captures conversations over OpenTelemetry or its SDKs (OpenAI Agents SDK, Vercel AI SDK, LangChain and LangGraph, Mastra, Pydantic AI, Google ADK, Agno), groups them by user and session, and judges each one against rules you write in plain language, such as "never tell a customer you can't issue a refund under $50." It also flags frustration, intents, and tool-call errors. When a failure crosses an alert threshold, Auto Improve opens a pull request on your linked GitHub repository with the prompt or code change, tested against past runs: it replays the affected conversations and shows the results in the pull request.
You review and merge, exactly like the manual flow. About an hour after merge it re-checks the alert and records improved, unchanged, regressed, or inconclusive.
The teams whose agents keep getting better aren't smarter prompt writers, they just close the loop between what users actually do and what the prompt says. Read your conversations, fix by pattern, ship reviewable diffs.
If you'd rather have that loop run continuously instead of carving out transcript-reading time every week, that's the whole reason Agnost AI exists. Either way, let your real conversations drive the prompt, not your gut.
Find the failing conversations by intent, cluster the failure into one named pattern, write one prompt rule that fixes it, test the change against the past conversations that failed plus a set of healthy ones, and ship it as a reviewed pull request, then check the failure rate after release. Agnost AI runs this loop on production conversations: when an alert fires, Auto Improve opens a pull request with the fix tested against past runs for a human to review. Prompt optimizers such as DSPy's GEPA and Pydantic Logfire propose prompt edits from a metric or from production runs.
Agnost AI detects failures in production conversations and opens a pull request with a prompt or code fix tested against the affected past conversations. Pydantic Logfire's prompt optimization reads recent production runs and proposes one prompt edit at a time for you to accept. Arize AX Prompt Learning rewrites prompts from evaluator feedback. DSPy's GEPA evolves prompts against a training set and a metric you supply. LangSmith Engine and Selfship also open pull requests from production failures.
Tie it to data, not the calendar. If a new failure pattern crosses a meaningful share of your conversations, fix it now. If nothing is breaking, leave the prompt alone. Constant tweaking with no signal behind it is how prompts rot. Teams with real traffic usually find something worth fixing every week or two.
Small, targeted changes, almost always. One pattern, one diff. Big rewrites make it impossible to tell what helped, and they reintroduce bugs you already fixed. Rebuild from your documented patterns only when the prompt has become a long list of conflicting instructions.
Replay the conversations that showed the failure against the new prompt before you merge, and keep a golden set of healthy conversations to catch regressions. After release, compare the failure rate for that pattern on new traffic. If you can't measure it against real traffic, you're guessing.