Documentation Index
Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
- Python 3.11+ — The SDK uses modern Python features including
asyncio, type hints, and structural pattern matching - pip 21.0+ or Poetry 1.2+ for package management
- An active Synap account — Sign up at synap.maximem.ai
Install the SDK
Synap provides two official SDKs. The Python SDK is the primary integration path. The JavaScript/TypeScript SDK is available for Node.js environments.Python SDK
The package name uses a hyphen (
maximem-synap) but the import name uses an underscore (maximem_synap). Install with pip install maximem-synap, then from maximem_synap import MaximemSynapSDK in your code.httpx— Async HTTP client used by the SDK for transportpydantic— Data validation and settings managementcryptography— Credential handlinggrpcio— gRPC client for real-time streamingprotobuf— Required bygrpcioto deserialize streaming message schemas
protobuf is pulled in as a direct dependency. If you see ModuleNotFoundError: No module named 'google' at runtime — usually the first time the SDK opens its gRPC stream — your environment is missing it. Install it explicitly with pip install protobuf and re-run; see Troubleshooting below.gRPC streaming is enabled by default — no extra install needed. See Authentication for details.
JavaScript / TypeScript SDK
For Node.js environments with a Python 3.11+ interpreter available, install the JavaScript SDK:The Python SDK is the recommended primary integration path. The JavaScript wrapper exists so Node.js applications can share the same authentication, retry, and caching behavior — but it inherits the Python SDK’s runtime requirement.
Vercel AI SDK Middleware
If your application uses the Vercel AI SDK, use the@maximem/synap-vercel-adk middleware package. It wraps any LanguageModelV1-compatible model and injects Synap context automatically — no changes to your existing generateText / streamText calls.
ai >=3.0.0 as a peer dependency. TypeScript types are included.
Environment variables
The SDK reads configuration from environment variables. This is the recommended approach for production deployments.Your API key for SDK authentication. Generated in the Dashboard — navigate to your instance and click Generate API Key. Starts with
synap_.Logging verbosity for the SDK. Accepts standard Python logging levels:
DEBUG, INFO, WARNING, ERROR, CRITICAL. Defaults to INFO.Credential storage
The SDK reads the API key fromSYNAP_API_KEY (or the api_key= constructor argument) on every startup. There is no on-disk credential cache — the key lives wherever your secrets manager or environment configuration puts it.
Verify installation
Run this script to verify your installation and connectivity:verify_synap.py
Async-first design
The Synap SDK is async-first. All SDK methods that interact with Synap Cloud are For frameworks that already run an event loop (FastAPI, Sanic, aiohttp), use the SDK directly without wrapping.
async and must be called with await inside an async function.If you’re integrating with a synchronous codebase, use asyncio.run() to bridge the gap:Troubleshooting
ImportError: No module named 'maximem_synap'
ImportError: No module named 'maximem_synap'
Verify the package is installed in your active Python environment:If using a virtual environment, make sure it’s activated. If using Poetry, prefix commands with
poetry run.Connection refused or timeout during initialization
Connection refused or timeout during initialization
Check that:
- Your network allows outbound HTTPS connections on port 443
- If behind a corporate proxy, configure
HTTPS_PROXYin your environment - Your
SYNAP_API_KEYis correct and the key is active in the dashboard
API key rejected
API key rejected
If the SDK reports an authentication failure:
- Confirm
SYNAP_API_KEYstarts withsynap_and is not wrapped in quotes in your shell - Check the key is still active in the Dashboard (Instance → API Keys)
- If the key was revoked, generate a new one and update your
.envor secrets manager
gRPC streaming not available
gRPC streaming not available
gRPC is included by default. Verify it imports cleanly:If the import fails, reinstall the SDK:
ModuleNotFoundError: No module named 'google'
ModuleNotFoundError: No module named 'google'
This surfaces the first time the SDK opens its gRPC stream — typically on Then re-run your script. If you are pinning versions in a lockfile, add
sdk.instance.listen() rather than sdk.initialize() — so the SDK can appear to start cleanly and then fail seconds later. The root cause is a missing protobuf package, which grpcio does not pull in transitively.Install it directly:protobuf>=4.0 alongside grpcio.Next steps
Authentication
Configure API key authentication, multiple keys per instance, and key rotation.
Integration
Connect Synap to your application framework and infrastructure.
SDK Initialization
Explore all SDK initialization options, including custom credential providers.