Skip to main content

agentics-you — Python SDK

The Python SDK for Agentics: shared memory for AI agents, with a receipt for every write. The same package carries the receipt helpers, the gateway client and the agentics CLI.

Install

pip install agentics-you

agentics-you on PyPI

pip install "agentics-you[openai]"    # + OpenAI Agents SDK trace processor (agentics_you.openai_agents)
pip install "agentics-you[litellm]"   # + LiteLLM callback (agentics_you.litellm_callback)

The import name is agentics_you. agentics on PyPI belongs to another publisher.

Quickstart

from agentics_you import AgenticsClient
client = AgenticsClient()  # reads AGENTICS_API_KEY
client.memories.add("Dana prefers aisle seats.", wait=True)

Memory in more detail

Create an org API key (ak_...) in the console under API Keys.

export AGENTICS_API_KEY=ak_...
export AGENTICS_AGENT=...   # optional: agent identity token, so writes are attributed to that agent
from agentics_you import AgenticsClient

client = AgenticsClient()

# Write. The API queues an ingest job; wait=True returns once the memory is indexed.
r = client.memories.add("Dana prefers aisle seats on flights over two hours.",
                        metadata={"topic": "travel"}, wait=True)

# Recall. Each hit carries score, why and receipt_hash.
hits = client.memories.search("Which seat does Dana want?", k=5)["hits"]

client.memories.get(r["memory_id"])
client.memories.list(limit=20)
client.memories.delete(r["memory_id"])
Resource Methods Route
client.memories add, search, list, get, delete, export /v1/memories, /v1/memories/search, /v1/memories/export
client.namespaces list, create, get, rename, delete /v1/namespaces
client.ingest get, list, retry, wait /v1/ingest, /v1/ingest/{job_id}

AsyncAgenticsClient has the same methods as coroutines. Errors are typed by status: ValidationError (400/413/422), AuthenticationError (401), PermissionDeniedError (403), NotFoundError (404), ConflictError (409), RateLimitError (429), ServerError (5xx), all subclasses of AgenticsError with code, status and details. Network errors, timeouts, 429, 502, 503 and 504 are retried with backoff (max_retries, default 2), honouring Retry-After. AGENTICS_BASE_URL points the client at another deployment. Stdlib only, Python 3.9+.

Receipts (decorator)

from agentics_you import Network

net = Network(api_key="ak_...")

@net.task(
    agent_id="support-bot",
    foundation_model="anthropic/claude-opus-4-6",
    scope=["read:tickets", "write:reply"],
)
def handle_ticket(ticket_id: str) -> str:
    # your agent logic
    return "Thanks for reaching out!"

reply = handle_ticket("abc-123")
# A receipt was recorded.

Receipts (context manager)

from agentics_you import Agentics

agentics = Agentics(api_key="ak_...")

with agentics.track(
    agent_id="support-bot",
    foundation_model="anthropic/claude-opus-4-6",
    model_version="2026-04-22",
    scope=["read:tickets", "write:reply"],
) as task:
    reply = run_my_agent(...)
    task.set_outputs(reply)
    task.set_outcome("success")

Gateway — drop-in OpenAI-compatible client

Change one base_url and keep your existing OpenAI/Anthropic SDK. Every call is routed, budgeted, guardrailed, and lands a cryptographically verifiable receipt on the trust-ledger — written server-side by Proof Mesh (the SDK never hashes, signs, or sets billable).

from openai import OpenAI                  # your existing SDK, unchanged
from agentics_you import createHeaders

client = OpenAI(
    base_url="https://agentics.you/api/v1",   # the only change
    api_key="ak_...",                              # your Agentics gateway key
    default_headers=createHeaders(user="alice@acme.com",
                                  metadata={"cost_center": "support"}),
)
resp = client.chat.completions.create(
    model="@anthropic/claude-opus-4-8",
    messages=[{"role": "user", "content": "hi"}],
)

Or use the self-contained client (stdlib only, no openai needed):

from agentics_you import AgenticsGateway

gw = AgenticsGateway(base_url="https://agentics.you/api/v1", api_key="ak_...")
resp = gw.with_options(user="alice@acme.com").chat.completions.create(
    model="@anthropic/claude-opus-4-8",
    messages=[{"role": "user", "content": "hi"}],
)

# Auto-instrument CrewAI / LangGraph, or attach LangChain/LlamaIndex handlers:
from agentics_you import LangchainCallbackHandler
chain.invoke(x, config={"callbacks": [LangchainCallbackHandler(user="alice@acme.com")]})

# Browse the Model Garden catalog:
gw.list_models(provider="anthropic")

createHeaders() emits the frozen x-agentics-{trace-id,span-id,user,meta,debug} header set; these become the parent receipt's identity fields, so per-user attribution and provable savings start at your call site. Full quickstart: https://agentics.you/docs/sdk/python.html.

Authentication

The SDK looks for an API key in this order:

  1. api_key= constructor argument
  2. AGENTICS_API_KEY environment variable
  3. ~/.agentics/credentials (set by agentics login --api-key ak_...)

Issue API keys from the dashboard at https://agentics.you/dashboard/api-keys.

CLI

# Save credentials
agentics login --api-key ak_...

# Register / update an agent from a manifest
cat > agentics.json <<EOF
{
  "display_name": "Support Bot",
  "handle": "support-bot",
  "foundation_model": "anthropic/claude-opus-4-6",
  "scope_array": ["read:tickets", "write:reply"],
  "description": "Handles tier-1 support tickets"
}
EOF
agentics deploy

# Or override fields inline
agentics deploy --name "Support Bot" --model anthropic/claude-opus-4-6 \\
                --scope "read:tickets,write:reply"

# Inspect your account
agentics whoami
agentics agents

# Gateway devex verbs
agentics gateway test --url https://agentics.you/api/v1 --user alice@acme.com
agentics config validate gateway-config.json
agentics config publish  gateway-config.json --name default
agentics prompt push     support-greeting.json
agentics log tail --limit 5            # gateway receipts with their trace_id
agentics proof verify    <receipt_hash>  # 4-step end-to-end verify
agentics proof bundle    <receipt_hash>  # offline-verifiable evidence bundle
agentics models --provider anthropic

Publishing (for maintainers)

Published from sdks/python/ to PyPI as agentics-you (1.2.1 is live: https://pypi.org/project/agentics-you/) by .github/workflows/pypi-publish.yml, with PyPI Trusted Publishing (OIDC, no token on this repo):

# Bump version in pyproject.toml and agentics_you/version.py, then tag sdk-py-v<semver>.
git tag sdk-py-v1.2.1
git push origin sdk-py-v1.2.1

The action runs the unit tests, writes the tag's version into both version files, builds the sdist and wheel, runs twine check, and publishes. Trusted publishing for this repo is already set at https://pypi.org/manage/account/publishing/ (workflow pypi-publish.yml, environment pypi).

Apache-2.0

Metadata

Release files for agentics-you 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentics-you 1.2.1
File Size Uploaded Provenance Actions
agentics_you-1.2.1.tar.gz 31.9 kB Without provenance Details for agentics_you-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentics-you 1.2.1
File Interpreter ABI Platform Actions
agentics_you-1.2.1-py3-none-any.whl Python 3 none any Details for agentics_you-1.2.1-py3-none-any.whl

Total release size: 65.5 kB

Release files / agentics_you-1.2.1.tar.gz

Download URL agentics_you-1.2.1.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3ad42a5a293cfc8364d7c8733648abb661a53120f46d0ab5e6e70dbab67f702e
BLAKE2b-256 checksum
How to use checksums
93fcffbf71526235821b9611bdb80ebad93a78d7a18ff97f704398c4777c418a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / agentics_you-1.2.1-py3-none-any.whl

Download URL agentics_you-1.2.1-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7315510ccc6cc4052557b3d279457859e2ac90ba87f504c2f8c33a835fd3d4ba
BLAKE2b-256 checksum
How to use checksums
b5c2552c7667540091df780f3cb69c56cc1ffe98ab18211e79c57664089b34db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for agentics-you 1.2.1

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.

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