Skip to main content

Python SDK for AgenticOrg - run agents, generate agents/workflows, use KB, A2A, and MCP

Project description

AgenticOrg Python SDK

Run AI agents, generate agents from plain English or SOPs, discover A2A/MCP tools, search knowledge, and create/run workflows from Python or the terminal.

Install

pip install agenticorg

Quickstart (Python)

from agenticorg import AgenticOrg, AgentRunResult

client = AgenticOrg(api_key="your-key")

# List agents
agents = client.agents.list(domain="finance")

# Run an agent
result: AgentRunResult = client.agents.run("ap_processor", inputs={
    "invoice_id": "INV-001",
    "vendor_id": "V-100",
})
print(result.status)      # "completed"
print(result.confidence)  # 0.95
print(result.output)      # {...structured result...}

# Buyer/seller commerce discovery via the seller commerce agent
commerce: AgentRunResult = client.agents.run(
    "commerce_sales_agent",
    action="buyer_discovery_preview",
    inputs={
        "merchant_id": "merchant_demo",
        "query": "Show available laptop stands under Rs 3000",
    },
)
print(commerce.status, commerce.output)

# Generate any launchable AI-template agent from skills/tools/connectors context
draft_agent = client.agents.generate(
    "Create a contract intelligence agent that uses Confluence knowledge, "
    "Jira issues, and vendor policy documents to review renewal risk.",
)
print(draft_agent["suggestions"][0]["agent_type"])

# Create an agent directly
agent = client.agents.create(
    name="Invoice Validator - GST Specialist",
    agent_type="invoice_validator_gst",
    domain="finance",
    llm_model="claude-3-5-sonnet-20241022",
    confidence_floor=0.90,
    hitl_condition="total > 500000 OR einvoice_failed==true",
    authorized_tools=[
        "oracle_fusion:read:purchase_order",
        "gstn_api:read:validate_gstin",
    ],
    initial_status="shadow",
)
print(agent["agent_id"])     # new agent UUID
print(agent["status"])       # "shadow"

# Create agent from SOP
sop_draft = client.sop.parse_text("""
Step 1: Receive invoice from vendor
Step 2: Validate GSTIN on GST portal
Step 3: 3-way match with PO and GRN
Step 4: If amount > 5L, escalate to CFO
Step 5: Post journal entry
""", domain_hint="finance")

# Review and deploy
agent = client.sop.deploy(sop_draft["config"])
print(agent["agent_id"])  # deployed as shadow agent

# Search tenant knowledge and generate/run workflows
matches = client.knowledge.search("vendor renewal policy", top_k=3)
workflow_draft = client.workflows.generate(
    "When a contract renewal is 30 days away, search knowledge, check Jira, "
    "ask contract_intelligence to summarize risk, then notify vendor_manager.",
)
workflow = client.workflows.create(
    name="Renewal Risk Review",
    definition=workflow_draft["workflow"],
    domain="ops",
)
run = client.workflows.run(workflow["id"], payload={"vendor_id": "V-100"})
print(matches[0]["document_name"], run["run_id"])

Quickstart (CLI)

# Set your API key
export AGENTICORG_API_KEY=your-key

# List agents
agenticorg agents list
agenticorg agents list --domain finance

# Run an agent
agenticorg agents run ap_processor --input '{"invoice_id": "INV-001"}'
agenticorg agents run commerce_sales_agent --action buyer_discovery_preview --input '{"merchant_id":"merchant_demo"}'

# Generate agents, query knowledge, and run workflows
agenticorg agents generate "Create a contract intelligence agent using Confluence and Jira"
agenticorg knowledge search "vendor renewal policy" --top-k 3
agenticorg workflows generate "Review vendor renewal risk using KB and Jira"
agenticorg workflows run wf-123 --input '{"vendor_id":"V-100"}'

# Parse SOP and create agent
agenticorg sop parse --file invoice_sop.pdf --domain finance

# View A2A agent card
agenticorg a2a card

# List MCP tools (for ChatGPT/Claude)
agenticorg mcp tools

Authentication

Three options:

  1. API Key (dashboard users): AgenticOrg(api_key="your-key")
  2. Grantex Grant Token (external agents): AgenticOrg(grantex_token="eyJ...")
  3. Environment variable: AGENTICORG_API_KEY or AGENTICORG_GRANTEX_TOKEN

Resources

Resource Methods
client.agents list(), get(id), run(type, inputs=...), create(...), generate(description, deploy=False)
client.connectors list(), get(id)
client.sop parse_text(text), upload(file), deploy(config)
client.a2a agent_card(), agents()
client.mcp tools(), call(name, args)
client.workflows templates(), list(), generate(description), create(...), get(id), run(id, payload=...), get_run(id)
client.knowledge search(query, top_k=5)

License

Apache-2.0

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

agenticorg-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

agenticorg-0.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file agenticorg-0.3.0.tar.gz.

File metadata

  • Download URL: agenticorg-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for agenticorg-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fc84f96a58e4943f0ccb1c2f8b83955591b8a8dcc28cbf0562cdb04df5cd6b44
MD5 e8c7195ac36c2a451a3e9b8d62180874
BLAKE2b-256 08b062efa06c85b88808d6308f1e6b94304beebdabcc061cfcc29c4b9ed357c2

See more details on using hashes here.

File details

Details for the file agenticorg-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agenticorg-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for agenticorg-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b71877619902df4cf8b85d26aec73a71d33aa5a1058cbe72d63803abed266bf9
MD5 cf67dde760ebbb2c9fac2894ec2c3876
BLAKE2b-256 c736b9a56b73a98dfbe744edf34243672bfe6aa74bb76faff3af51416d0ade53

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