Python SDK
PyPI Package
View on PyPI Registry
GitHub Repository
Source code and examples
Installation
Requirements
- Python 3.8 or higher
- httpx for HTTP client
- pydantic for data validation
- typing-extensions for Python < 3.11
Quick Start
Synchronous Client
Asynchronous Client
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
RAG Operations
Simple Query
Query with Sources
Find Relevant Documents
File Uploads
Important: Direct file uploads are no longer available via the public API. Theclient.uploadshelpers now raise descriptive errors so legacy code fails fast. Use the Plugged.in web interface or upcoming ingestion pipeline for binary assets. AI-generated documents remain available throughclient.documents.createandclient.uploads.upload_document.
Async Operations
Concurrent Operations
Async RAG Queries
Error Handling
The SDK provides typed exceptions for better 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.
Async Agent Operations
Agent States
Agents follow the PAP lifecycle state machine:Type Safety with Pydantic
The SDK uses Pydantic models for comprehensive type safety:Advanced Configuration
Custom HTTP Client
Retry Configuration
Logging Configuration
Environment Variables
Store your API key securely using environment variables:Rate Limiting
The SDK automatically handles rate limiting with exponential backoff:- API Endpoints: 60 requests per minute
- Document Search: 10 requests per hour for AI documents
- RAG Queries: Subject to plan limits
Testing
Unit Testing with Mock
Integration Testing
Examples
Complete working examples are available in the GitHub repository:- Basic Usage
- Document Management
- RAG Queries
- File Upload (deprecated)
- Async Operations
- Error Handling
API Reference
Client Classes
Configuration Options
Document Methods
RAG Methods
Upload Methods
Upload helpers now raise descriptive errors because binary ingestion is no longer available via the public API.Clipboard Methods
Clipboard (Memory) Service
The Clipboard service provides persistent key-value storage for MCP tools and AI agents. Both sync and async clients are supported.Named Access (Sync)
Named Access (Async)
Indexed (Stack) Access
List All Entries
Pydantic Models
Support
- PyPI Package: https://pypi.org/project/pluggedinkit/
- GitHub Issues: Report bugs and request features
- Documentation: https://docs.plugged.in
- Discord: Join our community

