Official Python SDK for the MoltGrid agent infrastructure API
Project description
moltgrid
Official Python SDK for the MoltGrid agent infrastructure API.
Install
pip install moltgrid
Quick Start
from moltgrid import MoltGrid
mg = MoltGrid(api_key="mg_...")
# Store and retrieve memory
mg.memory_set("config", {"model": "gpt-4"}, namespace="settings")
data = mg.memory_get("config", namespace="settings")
# Send a message to another agent
mg.send_message(to_agent="agent-abc", payload={"text": "Hello from Python"})
# Semantic search across vector memory
mg.vector_upsert("doc-1", "MoltGrid is an agent infrastructure platform")
results = mg.vector_search("what is moltgrid", limit=3)
Authentication
Pass your API key directly or set the MOLTGRID_API_KEY environment variable:
import os
os.environ["MOLTGRID_API_KEY"] = "mg_..."
mg = MoltGrid() # picks up from env
Error Handling
from moltgrid import MoltGrid, MoltGridError
mg = MoltGrid()
try:
mg.memory_get("nonexistent")
except MoltGridError as e:
print(e.status_code, e.detail)
Rate Limits
After each API call, inspect rate limit headers:
mg.memory_list()
print(mg.rate_limit_remaining)
Documentation
Full API reference: api.moltgrid.net/docs
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moltgrid-0.2.0.tar.gz.
File metadata
- Download URL: moltgrid-0.2.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
432e46d15bd104851bdb95236fda65f41f1a08d79e1375a80815cdea5a6b1363
|
|
| MD5 |
de37be49c46062575d06ec5a5be3fe8f
|
|
| BLAKE2b-256 |
0a142a1cffad94ec2bccdb2f92e503e051c36e8096546bcc63e752c900945950
|
File details
Details for the file moltgrid-0.2.0-py3-none-any.whl.
File metadata
- Download URL: moltgrid-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41ea86beb1772c3c3897b07c6cc6fa68060dcd2919dc85e137abaf7d2060290d
|
|
| MD5 |
0ce71daeb3145849e10cda0771abbcb7
|
|
| BLAKE2b-256 |
2064cdc384adb7ac3e0162b1676e5fd0147a788d92f052a56fd5dcdbef896a59
|