SDKs & API
Python
The MemLab Python SDK wraps the gateway REST API with typed helpers for ingesting Episodic Memory and running hybrid retrieval. Mint an API key in the dashboard, then follow the steps below.
- 1
Install the SDK
Add MemLab to your project with pip.
bashpip install memlab-ai
- 2
Initialize the client
Configure the client with the API key you minted in the dashboard.
pythonfrom memlab import MemLabClient client = MemLabClient( api_key="your-api-key", base_url="https://duevlcjdbpgye.cloudfront.net", ) - 3
Ingest an Episodic Memory
Send raw content to be extracted into Semantic Memory.
pythonresult = client.add( content="My name is Alice and I love hiking.", episodic_memory_type="MESSAGE", ) print(result) - 4
Search Semantic Memory
Query for facts ranked by relevance.
pythonresults = client.semantic_memories.search(query="What do I like?") for r in results: print(r["semantic_memory"]["content"])
More integrations