Skip to main content

Official Python SDK for the ARKNA AI Agent Observability platform

Project description

arkna

Official Python SDK for ARKNA — AI agent observability and incident intelligence.

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_BASE_URL API endpoint (default: https://api.arkna.com.au)

Requirements

  • Python >= 3.9
  • requests >= 2.28

License

MIT

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

arkna-3.2.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

arkna-3.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file arkna-3.2.0.tar.gz.

File metadata

  • Download URL: arkna-3.2.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.8

File hashes

Hashes for arkna-3.2.0.tar.gz
Algorithm Hash digest
SHA256 8b978029cd329b4dd53edb76babc824da7c5e840b7af957a0ac72cd3f407a9d5
MD5 76c1751e71d520f4be2f899ebb7d41aa
BLAKE2b-256 55ae07f3c9ea33830a9a1edaba5f7efa2bd0bb7698da7a2c22be59f39400a096

See more details on using hashes here.

File details

Details for the file arkna-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: arkna-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.8

File hashes

Hashes for arkna-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c95652c0d892a0088964ddaec1a60a683b78b3a08cc5f1e5256bcde877843682
MD5 fe2665b907c2f202ec9cf2598c5ccd71
BLAKE2b-256 338f1a7ca94e87f5983cd06613836bf155d3406eb288d467e70865dd1f051d02

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