Python SDK for sending agent traces to a remote Agent Skill Compiler backend.
Project description
Agent Skill Compiler
agent-skill-compiler is a Python SDK for sending agent traces from your application backend to a remote Agent Skill Compiler backend.
This package is for pip install only. It does not run the ASC server, database, or UI.
Install
pip install agent-skill-compiler
With Agno support:
pip install "agent-skill-compiler[agno]"
For Microsoft Agent Framework:
pip install agent-skill-compiler
pip install agent-framework --pre
What You Need
Your app backend needs these environment variables:
ASC_BASE_URL=http://your-asc-backend
ASC_PUBLIC_KEY=asc_pk_...
ASC_SECRET_KEY=asc_sk_...
Legacy aliases are also supported:
SKILL_COMPILER_HOST=http://your-asc-backend
SKILL_COMPILER_PUBLIC_KEY=asc_pk_...
SKILL_COMPILER_SECRET_KEY=asc_sk_...
Quick Start
from agent_skill_compiler import SkillCompilerTracer
tracer = SkillCompilerTracer.from_env(
optional=True,
default_agent_name="planner",
metadata={
"service": "app-backend",
"framework": "custom",
},
)
with tracer.trace(
task_name="ai_planner_chat",
input_text=user_prompt,
metadata={
"workflow": "ai_planner",
"session_id": session_id,
"user_id": user_id,
},
) as run:
tool_call = run.tool_call(
action_name="get_calendar_tasks",
semantic_name="list_user_tasks",
arguments={"user_id": user_id, "date": "today"},
)
tasks = load_tasks(user_id)
run.tool_result(
action_name="get_calendar_tasks",
semantic_name="list_user_tasks",
result={"task_count": len(tasks), "tasks": tasks},
parent_event_id=tool_call.event_id,
)
run.decision(
action_name="prioritize_tasks",
decision={"strategy": "due_date_then_importance"},
reason="Tasks exist and need ordering.",
)
run.final_output(output=assistant_response)
If the environment variables are missing and optional=True, the SDK becomes a safe no-op and will not break your app.
Low-Level Client
from agent_skill_compiler import SkillCompilerClient
client = SkillCompilerClient.from_env(optional=False)
run = client.start_run(
task_name="customer_followup",
input_text="Review this customer issue and prepare next steps.",
metadata={"service": "support-api", "workflow": "support_triage"},
)
event = client.record_event(
run_id=run.run_id,
agent_name="ResearchAgent",
action_name="search_docs",
action_kind="tool_call",
input_payload={"query": "latest billing escalation policy"},
)
client.record_event(
run_id=run.run_id,
agent_name="ResearchAgent",
action_name="search_docs",
action_kind="tool_result",
output_payload={"documents": ["billing-policy-v2"]},
parent_event_id=event.event_id,
)
client.finish_run(run_id=run.run_id, status="success")
client.close()
What The Tracer Captures
The generic tracer supports:
run.tool_call(...)run.tool_result(...)run.decision(...)run.route(...)run.message(...)run.error(...)run.final_output(...)run.update_metadata(...)
Use semantic_name=... on tool events when you want stable grouping across framework-specific tool names.
Helpers Exported By The SDK
SkillCompilerClientAsyncSkillCompilerClientSkillCompilerTracerAsyncSkillCompilerTracertrace_run(...)trace_run_async(...)serialize_for_trace(...)normalize_tool_arguments(...)get_first_attr(...)
Framework Integrations
Generic
from agent_skill_compiler import SkillCompilerClient, trace_run
client = SkillCompilerClient.from_env(optional=False)
with trace_run(
client,
task_name="support_triage",
input_text="Investigate this issue.",
metadata={"framework": "custom"},
) as run:
tool_call = run.tool_call(
action_name="search_docs",
arguments={"query": "refund policy"},
)
run.tool_result(
action_name="search_docs",
result={"documents": ["refund-policy-v2"]},
parent_event_id=tool_call.event_id,
)
run.final_output(output="Escalate to billing.")
Agno
from agent_skill_compiler import SkillCompilerClient, run_agno_agent
client = SkillCompilerClient.from_env(optional=False)
response = run_agno_agent(
agent,
client,
input="Summarize the latest billing guidance.",
task_name="billing_guidance",
metadata={"framework": "agno"},
)
Microsoft Agent Framework
from agent_skill_compiler import AsyncSkillCompilerClient, create_agent_framework_middleware
client = AsyncSkillCompilerClient.from_env(optional=False)
middleware = create_agent_framework_middleware(
client,
task_name="weather_assistant",
metadata={"framework": "microsoft-agent-framework"},
)
Important
- This package does not create ASC projects or keys.
- This package does not run the ASC backend.
- This package does not include the frontend.
- Keep
ASC_SECRET_KEYon the backend only.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_skill_compiler-0.4.0.tar.gz.
File metadata
- Download URL: agent_skill_compiler-0.4.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a385e8edca16b742e981e9c60fe0e828dca5c93a9ac416788d9d0a497df429b
|
|
| MD5 |
c3e8861fc5869b9d6fecb6ecf1436dca
|
|
| BLAKE2b-256 |
fdc9845ed15428a3ee7aeb7a5c3aaa54e4b4e74f3d423022074b4154482c6cdc
|
File details
Details for the file agent_skill_compiler-0.4.0-py3-none-any.whl.
File metadata
- Download URL: agent_skill_compiler-0.4.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f831a891784b658eb495b693096962e249cadea6ba73222fb0e4942e4b7c462a
|
|
| MD5 |
53d79978e6f686f3860f668f83742012
|
|
| BLAKE2b-256 |
78cef3851e10de82907f6bf354fb10ac2f52ec76c11e0deffd8e3947137ad828
|