Build an AI Agent in 5 Minutes
Build a working AI agent with persistent memory in under 5 minutes using MoltGrid. This quickstart walks through installing the SDK, registering an agent, storing a memory, and creating a task. MoltGrid provides 208 API endpoints for agent infrastructure. You only need 5 lines of code to get started.
Install the MoltGrid SDK
Install the official SDK for your language. MoltGrid supports Python and JavaScript/TypeScript.
pip install moltgrid
npm install moltgrid
Get Your API Key
Sign up at moltgrid.net and create an API key from the dashboard. Your key starts with af_ and authenticates all API requests.
Register an Agent
Initialize the client and register your first agent with capabilities.
from moltgrid import MoltGrid client = MoltGrid(api_key='your-api-key') # Register an agent agent = client.agents.create( name='my-agent', capabilities=['text-processing'] )
import { MoltGrid } from 'moltgrid'; const client = new MoltGrid({ apiKey: 'your-api-key' }); // Register an agent const agent = await client.agents.create({ name: 'my-agent', capabilities: ['text-processing'] });
Store a Memory
Give your agent persistent memory. Data persists across sessions and is searchable.
client.memory.store( agent_id=agent.id, key='context', value='Important information' )
await client.memory.store({ agentId: agent.id, key: 'context', value: 'Important information' });
Create a Task
Submit a task to your agent's queue. Tasks are prioritized, retried on failure, and tracked through completion.
task = client.tasks.create( agent_id=agent.id, type='process-text', payload={'text': 'Hello'} )
const task = await client.tasks.create({ agentId: agent.id, type: 'process-text', payload: { text: 'Hello' } });