Go SDK
Installation
Requirements
- Go 1.18 or higher
- No external dependencies beyond the standard library
Quick Start
Authentication
Get your API key from your Plugged.in Profile:Core Features
Document Management
List Documents
Get Document
Search Documents
Create AI-Generated Document
Update Document
Delete Document
RAG Operations
Simple Query
Query with Sources
Find Relevant Documents
File Uploads
Important: The Go SDK no longer exposes binary upload helpers. All previous
upload functions now return descriptive errors so legacy code fails fast.
Continue using DocumentsService.Create for AI-generated content and the
Plugged.in web interface (or forthcoming ingestion tools) for binary files.
Error Handling
The SDK provides typed error structs for comprehensive error handling:PAP Agents
The SDK provides full support for managing PAP (Plugged.in Agent Protocol) agents:Creating Agents
Listing and Managing Agents
Heartbeats and Metrics
CRITICAL: Heartbeats contain ONLY liveness data. Resource telemetry goes in metrics (separate channel). This separation is PAP’s zombie prevention superpower.
Concurrent Agent Operations
Agent States
Agents follow the PAP lifecycle state machine:Context and Cancellation
All SDK methods accept a context for cancellation and timeout control:Concurrent Operations
Leverage Go’s concurrency for parallel operations:Testing
Unit Testing with Interfaces
Integration Testing
Benchmarking
Advanced Configuration
Custom HTTP Transport
Environment Variables
Rate Limiting
The SDK handles rate limiting automatically:- API Endpoints: 60 requests per minute
- Document Search: 10 requests per hour for AI documents
- RAG Queries: Subject to plan limits
Examples
Complete working examples are available in the GitHub repository:- Basic Usage
- Document Management
- RAG Queries
- File Upload (deprecated)
- Error Handling
- Concurrent Operations
API Reference
Client Functions
| Function | Description |
|---|---|
NewClient(apiKey) | Create a new client with default settings |
NewClientWithOptions(apiKey, baseURL, httpClient) | Create a client with custom options |
Client Methods
| Method | Description |
|---|---|
SetAPIKey(apiKey) | Update the API key |
SetBaseURL(baseURL) | Update the base URL |
Document Service Methods
| Method | Description |
|---|---|
List(ctx, filters) | List documents with optional filters |
Get(ctx, id, includeContent, includeVersions) | Get a specific document |
Search(ctx, query, filters, limit, offset) | Search documents |
Create(ctx, request) | Create a new document |
Update(ctx, id, request) | Update an existing document |
Delete(ctx, id) | Delete a document |
RAG Service Methods
| Method | Description |
|---|---|
Query(ctx, query) | Returns RAGResponse with answer and metadata |
AskQuestion(ctx, query) | Simple RAG query (answer text only) |
QueryWithSources(ctx, query, projectUUID) | Query with source metadata (project argument optional) |
FindRelevantDocuments(ctx, query, projectUUID, limit) | Find relevant documents |
CheckAvailability(ctx) | Check RAG service availability |
GetStorageStats(ctx, userID) | Get storage statistics |
Upload Service Methods
Upload helpers now emit descriptive errors because binary ingestion is no longer exposed via the public API.Clipboard Service Methods
| Method | Description |
|---|---|
List(ctx) | List all clipboard entries |
Get(ctx, filters) | Get entry by name or index |
GetByName(ctx, name) | Get entry by name |
GetByIndex(ctx, idx) | Get entry by stack index |
Set(ctx, request) | Create or update named entry |
Push(ctx, request) | Push value to indexed stack |
Pop(ctx) | Pop and remove most recent entry |
Delete(ctx, request) | Delete specific entry |
DeleteByName(ctx, name) | Delete entry by name |
DeleteByIndex(ctx, idx) | Delete entry by index |
ClearAll(ctx) | Delete all entries |
Clipboard (Memory) Service
The Clipboard service provides persistent key-value storage for MCP tools and AI agents.Named Access
Indexed (Stack) Access
List All Entries
Type Definitions
Support
- Go Package: https://pkg.go.dev/github.com/veriteknik/pluggedinkit-go
- GitHub Issues: Report bugs and request features
- Documentation: https://docs.plugged.in
- Discord: Join our community

