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
httpx— Async HTTP client for REST API callspydantic— Data validation and settings managementcryptography— Credential handlinggrpcio— gRPC client for real-time streaming
gRPC streaming is enabled by default — no extra install needed. See Authentication for details.
JavaScript / TypeScript SDK
For Node.js environments, install the JavaScript SDK:The Python SDK is the recommended primary integration path. Use the JavaScript SDK when your application is Node.js-based and cannot run a Python subprocess.
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.
This package uses gRPC for real-time anticipation cache updates (optional) and falls back to HTTP context fetch on every call. gRPC is lazy-imported so it is safe to use in Next.js Edge Runtime — it simply skips the stream connection.
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:
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.