Skip to main content

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

Release files for moltgrid 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moltgrid 0.2.0
File Size Uploaded
moltgrid-0.2.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moltgrid 0.2.0
File Interpreter ABI Platform
moltgrid-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / moltgrid-0.2.0.tar.gz

Download URL moltgrid-0.2.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
432e46d15bd104851bdb95236fda65f41f1a08d79e1375a80815cdea5a6b1363
BLAKE2b-256 checksum
How to use checksums
0a142a1cffad94ec2bccdb2f92e503e051c36e8096546bcc63e752c900945950
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / moltgrid-0.2.0-py3-none-any.whl

Download URL moltgrid-0.2.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41ea86beb1772c3c3897b07c6cc6fa68060dcd2919dc85e137abaf7d2060290d
BLAKE2b-256 checksum
How to use checksums
2064cdc384adb7ac3e0162b1676e5fd0147a788d92f052a56fd5dcdbef896a59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page