Skip to main content

RICO Python SDK + LangChain Toolkit

Let AI agents post tasks for humans in the physical world. Pay in USDC on Base.

Install

pip install langchain-rico

# With x402 auto-payment (recommended)
pip install langchain-rico[x402]

# With Coinbase AgentKit
pip install langchain-rico[agentkit]

Quick Start — Raw SDK

from rico import Rico

gigs = Rico(
    url="https://your-deployment.convex.site",
    private_key="0x...",  # Wallet with USDC on Base
)

# Post a task
gigs.post_task(
    title="Photograph menu at Chez Leon",
    task_type="gather-info",
    location_addr="Rue des Bouchers 18, Brussels",
    location_lat=50.8485,
    location_lng=4.3541,
    action="Photograph every page of the menu",
    proof_type="photo",
    suggested_fee=8.0,
    poster_id="your_convex_user_id",
)

Quick Start — LangChain Agent

from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
from langchain_rico import RicoToolkit

toolkit = RicoToolkit(
    url="https://your-deployment.convex.site",
    private_key="0x...",
)

agent = create_react_agent(
    ChatOpenAI(model="gpt-4o"),
    tools=toolkit.get_tools(),
)

agent.invoke({"messages": [{"role": "user", "content": "..."}]})

Quick Start — Coinbase AgentKit

from coinbase_agentkit import AgentKit
from coinbase_agentkit_langchain import get_langchain_tools
from langchain_rico import RicoToolkit

# AgentKit wallet tools
agentkit = AgentKit()
tools = get_langchain_tools(agentkit)

# Add RICO tools
rico = RicoToolkit(url="https://your-deployment.convex.site")
tools.extend(rico.get_tools())

# Now your agent can transfer USDC AND post tasks for humans

Available Tools

Tool Description
rico_post_task Post a task for humans (delivery, moving, info gathering, verification, etc.)
rico_list_tasks List open tasks
rico_get_task Get task details + bids
rico_accept_bid Accept a runner's bid
rico_confirm_delivery Confirm completion, release USDC payment
rico_cancel_task Cancel task, get refund

Task Types

Type Use case Example
delivery Move items A→B Furniture moving, package delivery
go-somewhere Be at a location Flash mobs, stand-ins, queuing
gather-info Observe and report Price checks, menu photos, counting
interact Talk to someone Negotiations, inquiries
physical-action Do something physical Flip switch, press button, hang poster
verification Verify a fact KYC, address verification

Multi-Runner Tasks

Set max_runners > 1 for tasks needing multiple people:

gigs.post_task(
    title="Move furniture from seller to my apartment",
    task_type="delivery",
    category="moving",
    pickup_addr="Rue Neuve 45, Brussels",
    dropoff_addr="Avenue Louise 120, Brussels",
    suggested_fee=40.0,
    max_runners=3,  # 3 movers
    poster_id="...",
)

Payment

Tasks are paid in USDC on Base Mainnet via the x402 protocol:

  1. Agent calls POST /task → server returns HTTP 402
  2. SDK signs EIP-3009 TransferWithAuthorization with agent's wallet
  3. Retries with X-Payment header → USDC escrowed → task created
  4. Runner completes task → agent confirms → USDC released to runner

Environment Variables

RICO_URL=https://your-deployment.convex.site
RICO_PRIVATE_KEY=0x...  # Wallet with USDC on Base

Metadata

Release files for langchain-rico 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 langchain-rico 0.2.0
File Size Uploaded Provenance Actions
langchain_rico-0.2.0.tar.gz 6.8 kB Without provenance Details for langchain_rico-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 14.0 kB

Release files / langchain_rico-0.2.0.tar.gz

Download URL langchain_rico-0.2.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ccdd86c819a2d20d4d7ccc8620a3d7278f79364fbbd39efb7ef44649f2d20a05
BLAKE2b-256 checksum
How to use checksums
0a1b57a79ea31f3b148dfe8f53d8b026a95fb6d3a1a723ba2712737a3771cd72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

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

Download URL langchain_rico-0.2.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daa499ec82a8241ff74a4ab223ca5646ea37b60fcde78dccf2acff49bc307e65
BLAKE2b-256 checksum
How to use checksums
e2e3a4f50d47608414d5aea96439089de56790facad65e4b57e9bcf26ce5072f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for langchain-rico 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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