Skip to main content

The Connic Composer SDK for building agents and enterprise-level tools.

Project description

Connic Composer SDK

Build Connic agents in code.

Define agents in YAML, extend them with Python, test them with hot reload against Connic cloud, and deploy them to Connic-managed environments.

PyPI version Python 3.10+ License: MIT

DocumentationQuickstartAgent TemplatesDashboard


What It Is

connic-composer-sdk is the Python SDK and CLI for Connic's code-first agent workflow.

Use it to:

  • define agents in YAML
  • write custom tools as plain Python functions
  • add middleware, schemas, sessions, retries, concurrency, and guardrails
  • connect MCP servers and use Connic's predefined tools
  • validate projects locally before uploading anything
  • run hot-reload test sessions in isolated cloud environments
  • deploy to Connic from the CLI or through a connected Git repository

Installation

pip install connic-composer-sdk

Requires Python 3.10 or newer.

Quick Start

# Create a new project
connic init my-agents
cd my-agents

# Authenticate this project with Connic
connic login

# Validate the project locally
connic lint

# Start a hot-reload test session in Connic cloud
connic test

The default scaffold is intentionally minimal. If you want a starter project with working examples, use templates:

connic init my-agents --templates=invoice,customer-support

Browse available templates at connic.co/agents.

Example Project

my-agents/
├── agents/
│   └── support-assistant.yaml
├── tools/
│   └── billing.py
├── middleware/
│   └── support-assistant.py
├── schemas/
└── requirements.txt

agents/support-assistant.yaml

version: "1.0"

name: support-assistant
type: llm
model: gemini/gemini-2.5-pro
description: "Customer support agent with billing and knowledge access"
system_prompt: |
  You are a concise support agent.
  Use tools when they help produce a more accurate answer.

tools:
  - billing.lookup_invoice
  - query_knowledge

session:
  key: input.user_id
  ttl: 86400

guardrails:
  input:
    - type: prompt_injection
      mode: block
  output:
    - type: system_prompt_leakage
      mode: block

tools/billing.py

def lookup_invoice(invoice_id: str) -> dict:
    """Look up invoice status by invoice ID.

    Args:
        invoice_id: The invoice identifier

    Returns:
        Invoice details for the requested invoice
    """
    return {
        "invoice_id": invoice_id,
        "status": "paid",
        "amount": 199.0,
        "currency": "USD",
    }

Run:

connic lint
connic tools
connic test

Core Concepts

Agent Types

See Agent Configuration for the full YAML reference.

  • llm: an LLM-driven agent with prompts, tools, MCP servers, schemas, and guardrails
  • tool: a direct wrapper around a Python tool
  • sequential: a pipeline that executes multiple agents in order

Tools

Custom tools are plain Python functions discovered from tools/, including nested modules. Type hints and docstrings are used to generate tool schemas automatically. See Writing Tools for details.

The SDK also exposes predefined Connic tools such as the ones documented in Predefined Tools:

  • trigger_agent
  • trigger_agent_at
  • query_knowledge
  • store_knowledge
  • delete_knowledge
  • kb_list_namespaces
  • web_search
  • web_read_page
  • db_find
  • db_insert
  • db_update
  • db_delete
  • db_count
  • db_list_collections

Middleware and Runtime Controls

Per-agent middleware lets you modify inputs, enrich context, attach files, stop execution early, and transform outputs. See Middleware.

The YAML model also supports:

  • retries
  • timeouts
  • max iteration limits
  • key-based concurrency control
  • persistent sessions
  • output schemas
  • MCP server connections
  • input and output guardrails

Related docs:

CLI Commands

Command Description
connic init [name] Create a new project scaffold
connic init [name] --templates=... Create a project from one or more starter templates
connic login Save project credentials in .connic
connic lint Validate agents, tools, middleware, and schemas locally
connic tools List discovered tools and signatures
connic test [name] Start an isolated cloud test environment with hot reload
connic deploy Deploy from the CLI to a Connic environment for projects without a connected Git repository
connic migrate Migrate a LangChain or Google ADK project into a Connic project

Run connic <command> --help for flags and examples.

Development Workflow

Local Validation

connic lint loads your project locally and catches issues like:

  • invalid YAML
  • missing required agent fields
  • unresolved tool references
  • duplicate agent names
  • schema and middleware loading problems

Hot-Reload Testing

connic test creates an isolated development environment in Connic cloud, uploads your local files, and re-syncs changes in a few seconds while you iterate.

This is the main development loop when you need real connectors, predefined tools, and environment-scoped services.

Deployment

Deployment targets Connic-managed environments.

  • If your Connic project is connected to a Git repository, pushing to the configured branch is the primary deployment flow.
  • connic deploy is available for CLI-driven deployments and for projects that do not use a connected repository.

Documentation

Topic Link
Overview connic.co/docs/v1/composer/overview
Quickstart connic.co/docs/v1/quickstart
Agent Configuration connic.co/docs/v1/composer/agent-configuration
Writing Tools connic.co/docs/v1/composer/write-tools
Middleware connic.co/docs/v1/composer/middleware
Predefined Tools connic.co/docs/v1/composer/predefined-tools
MCP connic.co/docs/v1/composer/mcp
Testing connic.co/docs/v1/composer/testing
Variables connic.co/docs/v1/composer/variables
Guardrails connic.co/docs/v1/composer/guardrails
Knowledge Tools connic.co/docs/v1/composer/knowledge-tools
Database Tools connic.co/docs/v1/composer/database-tools

Contributing

See CONTRIBUTING.md.

Support

License

MIT. See LICENSE.

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

connic_composer_sdk-0.1.13.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

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

connic_composer_sdk-0.1.13-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file connic_composer_sdk-0.1.13.tar.gz.

File metadata

  • Download URL: connic_composer_sdk-0.1.13.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for connic_composer_sdk-0.1.13.tar.gz
Algorithm Hash digest
SHA256 f9c5711e18eaa82f8d00b7475734e61fc85e871137e1530313ae003c2dabd2e3
MD5 37a3805d374d9410178b34ffb733517d
BLAKE2b-256 f3149db3e91f64dfb6caeabc4cf176de3132163f59b8f4cc698155f50512f0fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for connic_composer_sdk-0.1.13.tar.gz:

Publisher: publish.yml on connic-org/connic-composer-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file connic_composer_sdk-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for connic_composer_sdk-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 dc0bbf3b489431aff7599d0dbf791eb86a0262475933183a718429e8ad938819
MD5 42ac69b2bcca9670243ed06139c9ffa2
BLAKE2b-256 cd961b368a35feb1a6936e0b263711a3db424b6bdd5cdaf38c591443ae4a6d1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for connic_composer_sdk-0.1.13-py3-none-any.whl:

Publisher: publish.yml on connic-org/connic-composer-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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