Skip to main content

Installation

Source code and releases live in raindrop-ai/go.

Quick Start: Interaction API

The Interaction API uses a simple three-step pattern:
  1. Begin() – Create an interaction and log the initial user input
  2. Update – Optionally call SetProperty, SetProperties, SetInput, or AddAttachments
  3. Finish() – Record the AI’s final output and close the interaction

Example: Chat Completion

Updating an Interaction

Update an interaction at any point using SetProperty, SetProperties, SetInput, or AddAttachments:

Resuming an Interaction

If you no longer have the interaction object returned from Begin(), resume it with ResumeInteraction():
ResumeInteraction() recovers an active in-memory interaction created by Begin() in the same process. It is not a cross-process restore mechanism. If the event ID is not found in memory, a new interaction handle is created for that ID.

Single-Shot Tracking (TrackAI)

For simple request-response interactions, you can use TrackAI() directly:
We recommend using Begin()Finish() for new code to take advantage of partial-event buffering, tracing, and upcoming features like automatic token counts.
Use TrackEvent() for non-AI events:

Tracking Signals (Feedback)

Signals capture quality ratings on AI events. Use TrackSignal() with the same event ID from Begin() or TrackAI():

Identifying Users


Attachments

Attachments let you include additional context—documents, images, code, or embedded content—with your events. They work with both Begin() interactions and TrackAI() calls.

Configuration

Call client.Close() before your process exits to flush any buffered events and spans. If writeKey is omitted, the client becomes a no-op instead of failing.

Projects

Pass WithProjectID to scope every event from a client to a specific project. Under the hood this sets the X-Raindrop-Project-Id header on each request.
A project slug is up to 63 lowercase letters, digits, and hyphens, and it must start and end with a letter or digit (^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$). Omitting WithProjectID (or passing "default") sends to the default Production project, which is the existing behavior, so single-project orgs need nothing here. See Projects for isolation, archival, and the full behavior table.

Tracing

Tracing captures detailed execution information from your AI pipelines—multi-model interactions, chained prompts, and tool calls. This helps you:
  • Visualize the full execution flow of your AI application
  • Debug and optimize prompt chains
  • Understand the intermediate steps that led to a response

Using WithSpan

Use WithSpan to trace tasks or operations:

Using WithTool

Use WithTool to trace agent tool calls with automatic input/output capture:
WithTool is a generic function—the return type matches your callback’s return type.

Manual Tool Tracking

For more control over tool span tracking, use TrackTool or StartToolSpan.

TrackTool – Retroactive Logging

Use TrackTool to log a tool call after it has completed:

StartToolSpan – Real-Time Tracking

Use StartToolSpan to track a tool as it executes:

Standalone Tracer

Use Tracer() for batch jobs or non-conversation work where you still want spans and tool traces:

Span Attributes

The SDK provides helpers for creating OTLP-compatible attributes:

That’s it! You’re ready to explore your events in the Raindrop dashboard. Ping us on Slack or email us if you get stuck!