Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Latest commit

 

History

History
107 lines (90 loc) · 3.02 KB

File metadata and controls

107 lines (90 loc) · 3.02 KB

CrewAI ↔ OSOP Interop

OSOP (Open Standard Operating Procedures) is a YAML-based workflow standard. This example shows how CrewAI workflows can be represented in OSOP format for portability across tools.

Why?

  • Portability: Define your crew once, run it anywhere (n8n, Airflow, Argo, LangGraph)
  • Visualization: Render crew workflows as Mermaid diagrams or interactive editors
  • Analysis: Risk assessment, optimization suggestions, execution reports

Example

A CrewAI research crew defined in OSOP format:

osop_version: "1.0"
id: "crewai-research-pipeline"
name: "Research Pipeline Crew"
description: "Three-agent crew that researches a topic, analyzes findings, and writes a report."
version: "1.0.0"
tags: [crewai, multi-agent, research, llm]

nodes:
  - id: "user_topic"
    type: "human"
    name: "Provide Research Topic"
    description: "User supplies a topic and desired depth (overview / deep-dive)."

  - id: "researcher"
    type: "agent"
    subtype: "llm"
    name: "Researcher Agent"
    description: "Searches the web, reads papers, and collects raw source material."
    config:
      role: "Senior Research Analyst"
      tools: [web_search, arxiv_search, url_reader]
      max_iterations: 5

  - id: "analyst"
    type: "agent"
    subtype: "llm"
    name: "Analyst Agent"
    description: "Synthesizes raw sources into structured insights and key findings."
    config:
      role: "Data Analyst"
      tools: [text_summarizer]
      max_iterations: 3

  - id: "writer"
    type: "agent"
    subtype: "llm"
    name: "Writer Agent"
    description: "Produces a polished markdown report with citations."
    config:
      role: "Technical Writer"
      tools: [markdown_formatter]
      max_iterations: 3

  - id: "human_review"
    type: "human"
    subtype: "review"
    name: "Review Report"
    description: "User reviews the final report and requests revisions if needed."

edges:
  - from: "user_topic"
    to: "researcher"
    mode: "sequential"
  - from: "researcher"
    to: "analyst"
    mode: "sequential"
  - from: "analyst"
    to: "writer"
    mode: "sequential"
  - from: "writer"
    to: "human_review"
    mode: "sequential"
  - from: "human_review"
    to: "writer"
    mode: "conditional"
    when: "revision_requested"
    label: "Revisions needed"

Convert Between Formats

# Install
pip install osop-interop

# CrewAI → OSOP
from osop_interop.importers.crewai import CrewAIImporter
importer = CrewAIImporter()
osop_yaml = importer.convert(open("agents.yaml").read(), tasks_yaml=open("tasks.yaml").read())

# OSOP → CrewAI
from osop_interop.exporters.crewai import CrewAIExporter
exporter = CrewAIExporter()
result = exporter.convert(osop_yaml)
# result = {"agents.yaml": "...", "tasks.yaml": "..."}

Links