Agent-receipts is an open-source tool that provides a structured audit trail for AI agents. It captures key elements like sources, risks, and confidence scores, ensuring that AI decisions are transparent and defensible, especially in regulated industries. This promotes trust and compliance while facilitating effective human oversight. Give it a star!!!
Built by a 17y/o dev,
AI Receipt Ledger: A comprehensive solution for creating structured audit trails for AI agent sessions. This open-source tool enhances transparency in AI operations by transforming complex AI responses into auditable receipts. It allows for detailed documentation of sources, risks, confidence levels, and review notes, making it an invaluable resource in scenarios where the cost of errors is significant.
Using AI Receipt Ledger is straightforward, with minimal configuration required:
Automatically generate receipts for AI responses with high compatibility using the quickReceipt function:
import { quickReceipt, exportReceiptToMarkdown } from "agent-receipts";
// Wrap your AI call directly with quickReceipt.
const { answer, receipt } = await quickReceipt(task, openai.chat.completions.create({ ... }));
// Export the receipt as a "Mini Slip".
console.log(exportReceiptToMarkdown(receipt));
For more granular control, integrate with the attachReceiptToResponse helper:
import { attachReceiptToResponse } from "agent-receipts";
const { answer, receipt } = await attachReceiptToResponse(task, async () => {
const res = await openai.chat.completions.create({ ... });
return {
text: res.choices[0].message.content,
model: "gpt-4o",
confidenceScore: 95,
sources: [{ title: "My PDF", url: "..." }],
};
});
Generate variations of receipt formats for different use cases:
// Export a Compact "Mini Slip" for quick sharing.
const mini = exportReceiptToMarkdown(receipt, { mode: "mini" });
// Create a Detailed Audit Log for comprehensive reporting.
const full = exportReceiptToMarkdown(receipt, { mode: "full" });
src/core: Core Receipt engine (Types, Validation, Export)src/react: Drop-in components and hooks for UI integrationexamples/: Guides for various integrations including Node, React, and Next.jsBy utilizing this project, AI developers can significantly enhance the reliability and traceability of their AI processes.
No comments yet.
Sign in to be the first to comment.