Skip to main content

arkna

Official Python SDK for Arkna, AI agent evidence: the independent, tamper-evident record of what your AI agents did.

Arkna records every run, step, and tool call your AI agents make, with full context and hash-chained integrity. When something goes wrong, replay the exact run and see what the agent knew at each step.

Installation

pip install arkna

With framework extras:

pip install arkna[langchain]    # LangChain integration
pip install arkna[crewai]       # CrewAI integration
pip install arkna[autogen]      # AutoGen integration

Quick Start

Auto-instrumentation (recommended)

Two lines. All OpenAI and Anthropic calls are captured automatically.

from arkna import init

init(api_key="ark_live_...", agent_name="my-agent")

# Your existing code — no changes needed
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}],
)
# ^ This call is automatically recorded by ARKNA

Or via environment variables (no code changes at all):

export ARKNA_API_KEY=ark_live_...
export ARKNA_AGENT_NAME=my-agent
from arkna import init
init()

Manual instrumentation

For full control over what gets recorded:

from arkna import ArknaClient

client = ArknaClient(api_key="ark_live_...", agent_name="my-agent")

run = client.start_run(trigger_type="api", input={"query": "refund policy"})

client.record_step(run["run_id"],
    step_type="reasoning",
    input="User asked about refund policy",
    output="Found 3 relevant documents",
)

client.record_tool_call(run["run_id"],
    tool_name="search_docs",
    input={"query": "refund"},
    output={"results": 3},
    status="success",
)

client.complete_run(run["run_id"], status="completed")

Framework Integrations

LangChain

from arkna import init, ArknaLangChainHandler

init(api_key="ark_live_...", agent_name="my-langchain-agent")
handler = ArknaLangChainHandler()

# Pass as callback to any LangChain chain/agent
result = chain.invoke({"input": "hello"}, config={"callbacks": [handler]})

CrewAI

from arkna import init, ArknaCrewAIHandler

init(api_key="ark_live_...", agent_name="my-crew")
handler = ArknaCrewAIHandler()

AutoGen

from arkna import init, ArknaAutoGenHandler

init(api_key="ark_live_...", agent_name="my-autogen-team")
handler = ArknaAutoGenHandler()

Configuration

Environment Variable Description
ARKNA_API_KEY API key (ark_live_...)
ARKNA_AGENT_NAME Agent name for identification
ARKNA_URL API endpoint (default: https://api.arkna.com.au)

Requirements

  • Python >= 3.9
  • requests >= 2.28

License

MIT

Metadata

Release files for arkna 4.0.2

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

Source distribution (sdist)

Source distribution for arkna 4.0.2
File Size Uploaded
arkna-4.0.2.tar.gz 42.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arkna 4.0.2
File Interpreter ABI Platform
arkna-4.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 83.1 kB

Release files / arkna-4.0.2.tar.gz

Download URL arkna-4.0.2.tar.gz
Size 42.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4488da0b8afd8755adf0b9a87c793a920b8b8b713c0a8a5b97ff6caca3934a66
BLAKE2b-256 checksum
How to use checksums
c808934aa69ff945740e73ef5f409a89535f987345b21a34b15702e6d843676f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release files / arkna-4.0.2-py3-none-any.whl

Download URL arkna-4.0.2-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
131c5b03cc49606289486a8963e4b85764bccffe492ac52a9b2df1ab135a08ec
BLAKE2b-256 checksum
How to use checksums
7b13c8cfbc8db98ef1c5c10481e9cfa498f4dec05ae9edec8290be8e6709e1ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release history Release notifications | RSS feed

This release

4.0.2 This release

2 release files

4.0.0

2 release files

3.2.0

2 release files

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