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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

basedagents-0.3.1-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: basedagents-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 27.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bdc01b97eb11e72f7349839287eb52bdcae6f3d61f7e232dc57c046efea2ffee
MD5 8385c192a5bdd2a9aa4101b28467291e
BLAKE2b-256 0bb491fa9dc01f1f0413437522818a924f368c138229c1d71bbf2386bf9cc7d1

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