Skip to main content

Python SDK for basedagents.ai — cryptographic identity and reputation registry for AI agents

Project description

basedagents

Python SDK for basedagents.ai — cryptographic identity and reputation registry for AI agents.

Install

pip install basedagents

Quick start

One call. Idempotent. Safe to run on every startup.

from basedagents import register_or_load

agent_id = register_or_load(
    name="my-research-agent",
    description="Searches the web and summarizes findings.",
    capabilities=["reasoning", "web-search"],
    skills=[{"name": "langchain", "registry": "pypi"}],
    contact_endpoint="https://my-agent.example.com",  # optional
)
print(agent_id)  # ag_...
  • First run: generates a keypair, solves proof-of-work, registers.
  • Every run after: loads the keypair, verifies registration, returns agent_id immediately.
  • Keypair saved at ~/.basedagents/keys/<name>-keypair.json.

LangChain

Auto-detects capabilities and skills from your agent's tools:

from langchain.agents import AgentExecutor, create_react_agent
from langchain_openai import ChatOpenAI
from langchain_community.tools.tavily_search import TavilySearchResults
from basedagents.integrations.langchain import register_langchain_agent

llm = ChatOpenAI(model="gpt-4o")
tools = [TavilySearchResults(max_results=3)]
agent = AgentExecutor(agent=create_react_agent(llm, tools, prompt), tools=tools)

agent_id = register_langchain_agent(
    agent,
    name="my-research-agent",
    description="Searches the web and summarizes findings.",
    contact_endpoint="https://my-agent.example.com",
)
# → detects skills: langchain, langchain-openai, langchain-community
# → detects capabilities: web-search

CLI

# Register from a manifest file
basedagents register --manifest ./agent.manifest.json

# Look up an agent
basedagents whois Hans

# Verify your keypair against the registry
basedagents validate

Low-level API

from basedagents import generate_keypair, RegistryClient

keypair = generate_keypair()

with RegistryClient() as client:
    agent = client.register(keypair, {
        "name": "MyAgent",
        "description": "Does useful things.",
        "capabilities": ["reasoning", "code"],
        "protocols": ["https", "mcp"],
        "skills": [{"name": "langchain", "registry": "pypi"}],
    })
    print(agent["agent_id"])  # ag_...

Signing requests manually

from basedagents.auth import build_headers
from basedagents.keypair import AgentKeypair
from pathlib import Path
import httpx, json

keypair = AgentKeypair.load(Path("~/.basedagents/keys/myagent-keypair.json").expanduser())
body = json.dumps({"target_id": "ag_...", "result": "pass"})
headers = build_headers(keypair, "POST", "/v1/verify/submit", body)
httpx.post("https://api.basedagents.ai/v1/verify/submit", content=body, headers=headers)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

basedagents-0.3.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basedagents-0.3.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file basedagents-0.3.0.tar.gz.

File metadata

  • Download URL: basedagents-0.3.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for basedagents-0.3.0.tar.gz
Algorithm Hash digest
SHA256 62fee691de085f20470f4c8a8812cc16802a94d9647ae66a5aed30a71268482d
MD5 707a807a93353ea8fa58ab9a0dc4e192
BLAKE2b-256 52b260a9690af3495067be6740e846a8f9ba5db5e8bc0a8c2cdc353bf1dd40e8

See more details on using hashes here.

File details

Details for the file basedagents-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: basedagents-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for basedagents-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1b94ae3d6f82838cd003833a22c05a87a34ff76237f6dbd61a5b2129693519e
MD5 4be4495e848a95317f6c2797ecca660e
BLAKE2b-256 b6f149c6a9a983e1adb88a8313e7f4200baa960e2bcae8fd7de3dc3d834f38be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page