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: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.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

