Mit KI-Agents nutzen
Gib Claude Code, Cursor oder einem anderen Coding-Agent diese Docs und einen Prompt, der Lyrelog in dein Projekt einbaut.
Jede Seite hier gibt es auch als reines Markdown. So kann ein Coding-Agent die Docs lesen, statt aus dem Gedächtnis zu raten. Bei einem neuen Dienst wie Lyrelog liegt der Agent damit meist daneben.
Dateien für Agents
| Adresse | Inhalt |
|---|---|
/llms.txt | Ein Index aller Seiten mit ihrer Beschreibung, jeweils mit Link auf ihr Markdown. Das llms.txt-Format, nach dem Agents suchen. |
/llms-full.txt | Alle Seiten in einer Datei, um die kompletten Docs auf einmal in den Kontext eines Agents zu laden. |
/<page>.md | Eine einzelne Seite, z. B. /sdks/go.md. |
Unter ihrem Titel hat jede Seite außerdem Copy Markdown und Open, um sie an ChatGPT, Claude oder Cursor zu schicken.
Ein Prompt, der Lyrelog in dein Projekt einbaut
Füg ihn in deinen Agent ein und ersetze lyr_ing_... durch deinen Ingest-Schlüssel (von der Seite
API keys des Projekts, siehe Schlüssel; er kann nur schreiben, deshalb darfst
du ihn in einer App ausliefern). Wenn du den Schlüssel lieber aus dem Repository heraushältst, leg
ihn in eine Umgebungsvariable und nenn dem Agent ihren Namen.
Add Lyrelog logging to this project. Read https://docs.lyrelog.com/llms.txt first, then the
page of the SDK for this project's language (or the HTTP API page if there's no SDK for it).
Don't rely on what you remember about Lyrelog: follow the docs.
1. Install the SDK and start it once, where the app or service starts, with the ingest key
lyr_ing_... (or from the environment variable LYRELOG_KEY). Keep the default endpoint.
2. Make sure queued events are sent before the process ends: flush or close the client as the
SDK page says for this kind of program (server, CLI, serverless function, app).
3. Capture errors: unhandled ones the way the SDK page shows, and the places in this code that
catch an error and carry on.
4. Log a few events where something happens to a person: sign in, a payment, a sync, a failed
request. Use a stable snake_case name as the message (payment_declined), a level, an area
(category) and attributes with the details to filter by.
5. Identify the person with our own user id (setUser or the SDK's equivalent), never an email
address, and clear it on sign-out.
6. Never put passwords, tokens, keys, cookies, full request bodies or personal data in messages,
attributes or payloads.
7. Tell me which environment the events will arrive under, so I can pick it in the dashboard.Die SDKs sind noch nicht veröffentlicht, deshalb kann ein Agent sie heute nicht installieren: Der Prompt funktioniert, sobald sie es sind. Bis dahin kann er Events über die HTTP-API senden.
Lass einen Agent deine Events lesen
Mit dem Kommandozeilen-Tool kann ein Coding-Agent Events durchsuchen, Fehler lesen und eine
Person durch eine Session verfolgen, angemeldet als du. Wenn ein Agent es ausführt, gibt es JSON
aus. Du meldest dich einmal mit lyrelog login an; der Agent kann sich nicht selbst anmelden.
Siehe Für Agents und Skripte, mit einem Prompt, um einen Fehler zu untersuchen.
Tipps
- Nenn die Seite. „Read https://docs.lyrelog.com/sdks/python.md and add Lyrelog to the FastAPI app“ ist schneller und genauer als eine Suche.
- Bitte um ein Test-Event. Lass den Agent beim Start der App ein Event loggen, die App ausführen und prüfen, ob es ankommt (siehe Schnellstart): So fällt ein falscher Schlüssel oder eine falsche Umgebung am schnellsten auf.
- Prüf, was er loggt. Agents loggen gern zu viel. Ein Event pro Vorgang mit einem stabilen Namen lässt sich leichter durchsuchen, auswerten und bezahlen als eine Zeile pro Funktionsaufruf.