DocumentationFramework Integration

Framework Integration

Invarium works with any AI agent framework. Here is how to describe your agent regardless of what you built it with.

The Invarium blueprint format is framework-agnostic — it describes what your agent does, not how it is implemented. However, different frameworks have different conventions for tools, workflows, and agent composition. This guide shows you how to map your framework’s concepts to an Invarium blueprint.


Framework overview

FrameworkAgent modelTool definitionMulti-agent
LangChainAgentExecutor, LCEL chains@tool decorator, Tool classLangGraph
CrewAICrew of agents with roles@tool decoratorBuilt-in (crews)
AutoGenConversable agentsFunction definitionsBuilt-in (group chat)
CustomAny implementationAny callableVaries

LangChain

Mapping LangChain concepts

LangChain conceptBlueprint field
Agent nameagent_name
@tool functionstools[]
System prompt rulesconstraints[]
Chain / graph stepsworkflows[]
LangGraph nodesworkflows[].steps[]

Example: LangChain agent blueprint

Given this LangChain agent:

@tool
def search_products(query: str) -> str:
    """Search the product catalog by name or category."""
    # ...
 
@tool
def check_inventory(product_id: str) -> dict:
    """Check current inventory levels for a product."""
    # ...
 
@tool
def place_order(product_id: str, quantity: int, customer_id: str) -> str:
    """Place an order for a product."""
    # ...

The blueprint would be:

{
  "agent_name": "ecommerce-assistant",
  "framework": "langchain",
  "description": "An e-commerce assistant that helps customers search products, check availability, and place orders.",
  "tools": [
    {
      "name": "search_products",
      "description": "Search the product catalog by name or category.",
      "parameters": {
        "query": "string — product name, category, or search terms"
      },
      "returns": "List of matching products with name, price, and ID.",
      "side_effects": "none"
    },
    {
      "name": "check_inventory",
      "description": "Check current inventory levels for a specific product.",
      "parameters": {
        "product_id": "string — the unique product identifier"
      },
      "returns": "Object with product_id, available_quantity, and warehouse_location.",
      "side_effects": "none"
    },
    {
      "name": "place_order",
      "description": "Place an order for a product on behalf of the customer.",
      "parameters": {
        "product_id": "string — the product to order",
        "quantity": "integer — number of units",
        "customer_id": "string — the customer placing the order"
      },
      "returns": "Order confirmation with order_id and estimated delivery date.",
      "side_effects": "payment"
    }
  ],
  "constraints": [
    "Always check inventory before placing an order",
    "Never place an order without the customer's explicit confirmation",
    "Do not recommend products that are out of stock",
    "Only discuss products available in our catalog"
  ],
  "workflows": [
    {
      "name": "purchase-flow",
      "trigger": "Customer wants to buy a product",
      "steps": [
        "Search for the product in the catalog",
        "Check inventory for the matching product",
        "If in stock, confirm the order details with the customer",
        "Place the order after customer confirmation"
      ]
    }
  ]
}

LangChain tips

  • Map each @tool decorated function to a tools[] entry
  • Extract constraints from your system prompt — every rule in the system prompt should be a constraint
  • If you use LangGraph, map each node to a step in a workflows[] entry
  • Include tool side_effects for any tool that writes data or triggers external actions

Common patterns

Regardless of framework, these patterns apply:

  • Every callable function is a tool. If your agent can call it, list it in tools[].
  • Every rule is a constraint. System prompts, guardrails, and business rules all become constraints[].
  • Every multi-step process is a workflow. If your agent follows a sequence of steps to complete a task, describe it in workflows[].
  • Be specific about side effects. Tools that only read data have "side_effects": "none". Tools that write data, send messages, or trigger external systems need their side effects documented. Use specific values like database_write, api_call, email_send, payment, etc.

Not sure if your blueprint is complete? Upload it and generate a small set of tests (5-10). If the tests feel generic or miss important behaviors, your blueprint needs more detail.

Was this page helpful?