Skip to main content
Connic

AI agents
with YAML and Python

Agents are defined in YAML, tools are written as Python functions, and every change goes through Git. No framework abstractions or infrastructure to run. Teams shipping backend code today can ship a production agent through the same workflow.

Read the SDK docs
agents/invoice-processor.yaml
# Define the whole agent in one YAML file
name: invoice-processor
model: connic/gpt-5.6-sol
reasoning_effort: auto
system_prompt: |
You are an expert accountant.
Extract every field from the invoice
and verify the totals add up.
tools:
- documents.parse
- documents.extract_entities
- database.store_invoice

One file. Every part of the agent.

Configuration, prompts, tools, schemas, and safety in a single declarative spec. Diffable in PR review, version-pinnable in CI.

agents/invoice-processor.yaml
version: "1.0"
name: invoice-processor
model: connic/gpt-5.6-sol
description: "Extracts data from invoices and stores them"
reasoning_effort: auto

system_prompt: |
  Extract every field from the invoice and
  verify the totals add up.

tools:
  - invoices.parse_pdf
  - invoices.extract_fields
  - invoices.store

output_schema: invoice-data  # references schemas/invoice-data.json

guardrails:
  input:
    - type: pii
      mode: redact
model

An exact connic/* model or a configured BYOK provider sets the model. Learn more

tools

Tools can reference custom Python functions in tools/ or built-in predefined tools. Learn more

output_schema

A JSON Schema file in schemas/ enforces structured JSON output. Learn more

guardrails

Inline PII redaction, prompt-injection defense, custom checks. Learn more

What the framework provides

Same agent, two definitions. The YAML on the left runs with the same guarantees as a hand-written Python implementation, without boilerplate that rots over time.

Connic, 12 lines
agents/support-triage.yaml
name: support-triage
model: connic/gpt-5.6-sol  # or anthropic/claude-opus-4-7 with Anthropic BYOK configured
description: "Triage incoming customer requests"

system_prompt: |
  Triage the customer's request and
  route to the right team.

tools:
  - retrieval_query
  - tickets.create
  - tickets.notify_team
LangChain, 27 lines, with a separate deployment
agents/support_triage.py
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_anthropic import ChatAnthropic
from langchain.prompts import ChatPromptTemplate
from tools import retrieval_query, ticket_create, notify_team

llm = ChatAnthropic(model="claude-opus-4-7")

tools = [retrieval_query, ticket_create, notify_team]

prompt = ChatPromptTemplate.from_messages([
    ("system", """Triage the customer's request and
        route to the right team."""),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(
    agent=agent,
    tools=tools,
    verbose=True,
    max_iterations=10,
    handle_parsing_errors=True,
)

# ...plus deployment, retries, observability,
# secrets, env config, telemetry, and more.

Use production capabilities built into the SDK

The SDK includes the production primitives that teams otherwise rebuild from scratch.

Variables

Per-environment env vars injected at runtime. Secrets are masked in the dashboard and in logs. See docs

Hooks

Python functions wrap each tool call to validate or rewrite params, redact results, or skip a tool with AbortTool. See docs

Middleware

Python before() and after() hooks wrap the whole run to attach documents, enrich context, or transform responses. See docs

Guardrails

PII redaction, prompt-injection detection, moderation, topic restriction, regex, and custom Python checks, all declared in YAML. See docs

Output schemas

A JSON Schema file in schemas/ forces the LLM into a typed JSON shape. See docs

MCP

Remote MCP tool servers connect over Streamable HTTP, with filters for specific tools or a discoverable setting for the whole server. See docs

How Connic compares

Composer SDK vs. building on LangChain, CrewAI, or a custom framework

How Connic compares
FeatureConnicLangChainCrewAIDIY
Config formatYAMLPython codePython codeCustom
Deployment includedIncludedNot includedNot includedNot included
Built-in observabilityIncludedNot includedPartialNot included
Retrieval (RAG)IncludedNot includedNot includedNot included
Connectors (Kafka, S3, etc.)IncludedNot includedNot includedNot included
A/B testingIncludedNot includedNot includedNot included
Human-in-the-loop approvalsIncludedNot includedNot includedNot included
Learning curveLowMediumMediumHigh
Migration toolingIncludedNot includedNot includedNot included

Build AI agents as a team

Migrate existing projects, review changes with your team, and manage versions in Git.

Migrate from LangChain or ADK

connic migrate converts LangChain, LangGraph, and Google ADK projects to Connic format while retaining prompts and tools without the framework boilerplate.

Review agents in pull requests

Agents live in the repository as YAML and Python. A Git branch maps to each environment so pushes auto-deploy to staging or production.

Pin model versions, audit diffs

Models are pinned by ID in the YAML (e.g. connic/glm-5.2 or anthropic/claude-opus-4-7). Tools and middleware are Python files in the repository, so every change is a Git commit with a reviewable diff.

Frequently Asked Questions

YAML keeps the agent's identity in one diffable file: model, prompts, tools, schemas, guardrails. Reviewers see exactly what changed in a PR without reading framework glue. Tools and middleware remain Python; the YAML is the spec.

Yes. Tools, middleware, and hooks are all Python. The same custom logic that would live in a framework can be implemented here. The YAML declares what to compose.

Model IDs are pinned explicitly in the YAML (e.g. connic/glm-5.2, anthropic/claude-opus-4-7). Tools, middleware, hooks, and guardrails are Python files in the same repo, so every change ships as a Git commit with a reviewable diff and is rollback-able with git revert.

Every Project supports EU-hosted connic/* models without separate provider credentials. BYOK options include OpenAI, Azure OpenAI, Anthropic, Google Gemini, OpenRouter, AWS Bedrock, Google Vertex AI, and custom OpenAI-compatible endpoints.

connic migrate runs inside the existing project. It scans LangChain, LangGraph, and Google ADK code and generates a Connic project: agents as YAML, tools as Python in tools/. MIGRATION_REPORT.md identifies the parts that need manual attention before connic lint runs.

Agents are defined in YAML files under agents/. Python lives in tools/, middleware/, hooks/, and guardrails/, where business logic, model orchestration extensions, and custom checks belong. The YAML is the spec; Python is the implementation.