Python SDK
Official Python SDK for MemoryKit. Sync and async clients, fully typed.
MemoryKit for scripts, AsyncMemoryKit for FastAPI and Django.
Catch AuthenticationError, RateLimitError, etc. — no string matching.
Uses httpx under the hood. One dependency, fully typed with py.typed.
Installation
Requires Python 3.8+. httpx is installed automatically.
Quick start
Configuration options
The client supports context managers for clean resource cleanup:
Sync vs Async — The default MemoryKit client is synchronous. For async frameworks like FastAPI, use AsyncMemoryKit (see below). Mixing sync calls inside async code will block the event loop.
Memories
Create and manage
Upload files
Supports PDF, DOCX, XLSX, PPTX, TXT, CSV, Markdown, HTML, and JSON.
Batch ingest
Up to 100 memories in a single request.
Reprocess
Triggers re-chunking and re-embedding for an existing memory.
Search
Hybrid search
Combines vector similarity, full-text search, and reranking.
RAG query
Coming Soon — memories.query() is not available in the current SDK release. Use memories.search() for retrieval. LLM-powered query with answer generation will be available in a future release.
Streaming
Coming Soon — memories.stream() is not available in the current SDK release. Use memories.search() for retrieval. Streaming responses will be available in a future release.
Chats
Coming Soon — Chat methods (chats.create(), chats.send_message(), chats.stream_message(), chats.get_history()) are not available in the current SDK release. Conversational RAG with chat sessions will be available in a future release.
Users
Webhooks
Error handling
All errors are typed — catch specific exception classes:
Retryable errors (429, 5xx) are automatically retried with exponential backoff up to max_retries times. You don't need to implement retry logic yourself.
Async usage
For async frameworks, swap MemoryKit for AsyncMemoryKit. Every method becomes await-able: