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.2.0.tar.gz (15.6 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.2.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for basedagents-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8eaaf50631483cfc87b9dd7827381b9dfbf440b9532ce71882e5a56c1efa87df
MD5 4d429090ca3ccafe4e65c920cfa76d96
BLAKE2b-256 782b5ba16764112256a3feb60e48340b813e5042b70cca1f2766a50c46987413

See more details on using hashes here.

File details

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

File metadata

  • Download URL: basedagents-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebb1de0b6c2e33211f6117b6adec1dd94097fd63e615f4a412a34d336ce45db0
MD5 e3c31f84246c71aab89bfa469b455efc
BLAKE2b-256 3caf3514a16b6a03583aee6df39a27c30958d5f06165bcfddd52ea48786684a2

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