Skip to main content

lyboai (Python SDK)

Python is the builder's language for the LyboAI ecosystem: create agents, package and sign capability packs, run evaluations, tune routing, and export training datasets. Agents execute in the Rust runtime — locally via the lybo binary (this SDK drives it over the JSON-lines protocol, identical to the on-device C ABI) and on phones via the mobile bindings.

pip install -e sdk/python        # from the repo, or publish to your index
cargo build -p lybo-cli           # the runtime the SDK drives

Create an agent

from lyboai import Client

with Client(data_dir="/tmp/agent", binary="./target/debug/lybo") as lybo:
    lybo.install_knowledge(doc_id="handbook", title="Team Handbook",
                           body="Support tickets are answered within 24 hours.")
    lybo.register_skill(skill_id="app.ask", name="Ask the handbook",
                        triggers=["what does the handbook say"],
                        keywords=["handbook"], pattern="retrieval")

    session = lybo.start_session()
    out = lybo.run_to_completion(session, "what does the handbook say about tickets")
    print(out["output"]["text"], out["output"]["sources"])

Train routing from labelled examples

from lyboai import train_triggers

learned = train_triggers({
    "faq.ask":  ["what does the guide say about refunds", "search the faq"],
    "task.plan": ["plan my week", "break this goal into steps"],
})
# → per-skill {"triggers": [...], "keywords": [...]} via class-discriminative
#   tf-idf; feeds both the keyword tier and the on-device semantic centroids.

Build, sign, evaluate, ship a pack

from lyboai import PackBuilder, sign_pack, evaluate

src = (PackBuilder("acme.faq", "FAQ", "1.0.0", publisher="acme")
       .add_knowledge("faq", "Store FAQ", "Refunds take five business days.")
       .add_skill("faq.ask", "Ask FAQ", pattern="retrieval",
                  triggers=learned["faq.ask"]["triggers"],
                  keywords=learned["faq.ask"]["keywords"],
                  knowledge_scopes=["acme.faq"])
       .add_eval_case("faq.suite", "routes", "what does the guide say about refunds",
                      expect_skill="faq.ask", expect_contains=["refund"])
       .save("pack.json"))
sign_pack("pack.json", SECRET_KEY_HEX, "dist/acme-faq.lybopack")

with Client(data_dir="/tmp/qa", trust=[f"acme:{PUBLIC_KEY_HEX}"]) as lybo:
    lybo.install_pack_file("dist/acme-faq.lybopack")
    report = evaluate(lybo, suite)          # routing + outcome + content checks
    assert report.ok, report.summary()      # gate your CI on this

Delegate to a cloud agent (agent-to-agent)

The local (device) agent can hand intensive work to a cloud LyboAI runtime — the agent.delegate tool / delegate workflow step, with PII redaction at the egress boundary and graceful local fallback (docs/cloud-delegation.md):

from lyboai import Client, HttpClient

# Provision / drive the cloud agent directly (lybo serve --http):
cloud = HttpClient("https://agent.example.com", token="SECRET")
print(cloud.healthz())

# A local agent that may delegate to it:
with Client(data_dir="/tmp/dev",
            remote_agents={"cloud.orchestrator": "https://agent.example.com"},
            remote_agent_token="SECRET") as lybo:
    lybo.register_workflow({...})   # workflow with a {"kind": "delegate"} step
    out = lybo.run_to_completion(lybo.start_session(), "run the deep analysis")

Export training data (privacy-preserving)

from lyboai import export_routing_dataset
export_routing_dataset(lybo, "routing.jsonl")
# skill ids, confidence, outcomes, latency, model ids — never raw user content.

Run the SDK's own tests: LYBO_BIN=./target/debug/lybo python3 -m unittest discover sdk/python/tests

Metadata

Release files for lyboai 0.5.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 lyboai 0.5.0
File Size Uploaded Provenance
lyboai-0.5.0.tar.gz 23.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 45.2 kB

Release files / lyboai-0.5.0.tar.gz

Download URL lyboai-0.5.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ec56267a34c1c10777f4f5233cd3f741a91ff8ad77b4e542f52cb90ad35859aa
BLAKE2b-256 checksum
How to use checksums
25652e50d428136f217df566a3a2e17c653ff1a03ddda8cdc83c0ddebce83aa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / lyboai-0.5.0-py3-none-any.whl

Download URL lyboai-0.5.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
065441770dc7583f0eb8e388f36d346814407423580a0bc3f72358c2f5063091
BLAKE2b-256 checksum
How to use checksums
46e9b39872869c3c61fa903e08a77117f06efe06c6749b4267b4c15866531c6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for lyboai 0.5.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.

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