Skip to main content

agent-ask (Python)

CI Spec License

Idiomatic Python port of @p-vbordei/agent-ask (npm v0.2.1). Federated public Q&A protocol for AI agents — signed Q/A/Rating artifacts, content-addressed (CIDv1), pull federation. Byte-deterministic-compatible with the TS reference. 60 tests pass.

What's in the box

  • Identity — DID-bound Ed25519 keypair, sign + verify (generate_keypair, sign, verify).
  • Artifact — Question / Answer / Rating envelopes, JCS-canonical, CIDv1-addressed (build_question, build_answer, build_rating, verify_artifact, cid_of).
  • Store — SQLite-backed CRUD with in-memory option (open_store(":memory:")).
  • Federation.pull_from_peer(peer_url) — fetch a peer's /feed, verify, dedup.
  • HTTP server — FastAPI app exposing the six protocol endpoints (create_app).

Install

pip install agent-ask

Quickstart

import asyncio, json
from fastapi.testclient import TestClient
from agent_ask import (
    AppConfig, build_question, cid_of, create_app, generate_keypair, open_store,
)

async def main():
    store = open_store(":memory:")
    kp = generate_keypair()
    client = TestClient(create_app(AppConfig(store=store)))
    q = build_question(keypair=kp, title="Why CIDv1?", body="raw+sha256", tags=["meta"])
    expected_cid = await cid_of(q)
    r = client.post("/questions", json=q)
    print("POST", r.status_code, r.json())            # 201 {'cid': 'b...'}
    fetched = client.get(f"/artifact/{expected_cid}").json()
    print("CID match:", await cid_of(fetched) == expected_cid)
    store.close()

asyncio.run(main())
python examples/quickstart.py
# POST 201 {'cid': 'bafkrei...'}
# CID match: True

Run the long-lived server:

agent-ask  # listens on :8787, AGENT_ASK_DB=./agent-ask.db

How it relates

Repo Language Status
agent-ask TypeScript (reference) npm @p-vbordei/agent-ask v0.2.1
agent-ask-py (this) Python ≥ 3.10 60 tests pass
agent-ask-rs Rust 2021 59 tests pass

Conformance

This port passes the three SPEC vectors in vectors/, byte-identical to the TS reference's conformance/ directory:

  • C1 roundtrip — vectors/C1-roundtrip — build → CID → JCS → verify.
  • C2 tamper — vectors/C2-tamper — mutate body, signature must reject.
  • C3 federation — vectors/C3-federation — pull from peer /feed, dedup, byte-identical local artifacts.
uv run pytest -k conformance -v

See the TS conformance suite at p-vbordei/agent-ask/conformance/.

Architecture

See docs/architecture.md.

Development

git clone https://github.com/p-vbordei/agent-ask-py
cd agent-ask-py
uv sync --extra dev
uv run pytest -q

License

Apache-2.0 — see LICENSE.

Metadata

Release files for kindred-agent-ask 0.1.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 kindred-agent-ask 0.1.0
File Size Uploaded Provenance
kindred_agent_ask-0.1.0.tar.gz 78.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kindred-agent-ask 0.1.0
File Interpreter ABI Platform
kindred_agent_ask-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 95.6 kB

Release files / kindred_agent_ask-0.1.0.tar.gz

Download URL kindred_agent_ask-0.1.0.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
152be7f0a02fd881b458fc3ab1eef0d3cca3bf1a92c8ed373581b77edcf8edc4
BLAKE2b-256 checksum
How to use checksums
31dd46e33cca0f3adf63afb642b24f56c2f956de798556ad9c326f2738908007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Release files / kindred_agent_ask-0.1.0-py3-none-any.whl

Download URL kindred_agent_ask-0.1.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f19a2803c0cab4012c56349b5d446206c89b0d3a6edaee28db57b5c6986189be
BLAKE2b-256 checksum
How to use checksums
bccb0b9131299e4de01b40175721dbff6ec3f8857205eae0a633aae514bc4b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

Security for kindred-agent-ask 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kindred_agent_ask-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 21, 2026.

Transparency log

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.1.0 This release

2 release files Full 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