dimies
v0.1.2
Published
Integrate Dimies (conversation analytics for AI agents) into any codebase in one command — human- and AI-coding-agent-friendly.
Downloads
25
Maintainers
Readme
dimies
Integrate Dimies — conversation analytics for AI agents — into any codebase in one command.
npx dimies init --key dm_live_… # scaffold a tracking helper (Node or Python)
npx dimies test --key dm_live_… # send a test conversation, verify end-to-end
npx dimies prompt # print an integration prompt for AI coding agents
npx dimies spec # print the machine-readable spec (llms.txt)The fastest path: let your coding agent do it
npx dimies prompt | pbcopyPaste into Claude Code (or Cursor, etc.) inside the repo you want instrumented. The agent fetches llms.txt from your Dimies instance and wires everything: fire-and-forget conversation tracking, trace spans around LLM/tool calls, env vars in .env.example.
What init does
- Detects Node (TS/JS) or Python
- Writes a zero-dependency
dimies.ts/dimies.js/dimies.pyhelper exportingtrackConversation(...)/track_conversation(...)— fire-and-forget, never throws, never blocks your response path - Adds
DIMIES_API_KEY/DIMIES_URLto.env.example(never hardcodes your key)
Flags
| Flag | Meaning |
|---|---|
| --key dm_live_… | Dimies API key (or env DIMIES_API_KEY) |
| --url https://… | Your Dimies instance URL (or env DIMIES_URL) |
| --dir path | Target directory for init (default .) |
| --lang node\|python | Override language detection |
Tracing
Pass a trace array of spans to trackConversation(...) to get a Langfuse-style execution tree on each conversation. Give every span a stable id, and set input/output to the payload — for an llm span, the prompt and the completion; for a tool span, the args and the result:
trackConversation({
conversation_id: chat.id,
messages,
trace: [
{ id: "llm-1", name: "vera.llm", type: "llm",
model: "gpt-4o", tokens_in: 1240, tokens_out: 85,
cost: 0.0017, // optional — exact spend; omit and Dimies estimates it
input: prompt, output: completion },
],
});Field names are exact — prompt/completion/response are silently dropped, so a span sent that way shows "No payload recorded". Merge is field-level and keyed by id: resend the same id to update a span (e.g. { id: "llm-1", status: "error" }) and only the fields you include change — the rest is preserved.
Cost accuracy: set model, tokens_in, tokens_out on llm spans and the Costs dashboard prices them at list rates. For exact spend (negotiated rates, caching), also send cost in USD from your provider's usage — it's used verbatim instead of the estimate.
Full span schema: <your-instance>/llms.txt.
MIT.
