circle-chevron-rightExternal Agent Integration

Integrating External Agents into Crowe

Crowe allows seamless integration of agents from other frameworks — including LangChain, Griptape, Hugging Face, Rasa, DialogFlow, and more — so you can orchestrate diverse AI systems under a single, unified agent workflow.

This section provides step-by-step guides to bring external agents into Crowe by creating new agent classes, implementing the required methods, and ensuring full compatibility.


Quick Overview

  1. Create a custom class inheriting from Agent in Crowe.

  2. Override the .run(task: str) -> str method to execute the external agent.

  3. (Optional) Add helper methods for saving output (JSON, DB, logs, etc.).


Crowe Agent Class Template

The foundation for any external integration is the Agent base class from Crowe.

from crowe import Agent
import json
from pathlib import Path

class ExternalCroweAgent(Agent):
    def run(self, task: str) -> str:
        # TODO: Replace with actual external agent logic
        return f"[ExternalCroweAgent] Received task: {task}"

    def save_to_json(self, output: str, filepath: str):
        try:
            Path(filepath).parent.mkdir(parents=True, exist_ok=True)
            with open(filepath, "w", encoding="utf-8") as f:
                json.dump({"response": output}, f, ensure_ascii=False, indent=2)
        except Exception as e:
            print(f"[ExternalCroweAgent] Failed to save JSON: {e}")

# Usage
agent = ExternalCroweAgent()
result = agent.run("Analyze dataset trends")
agent.save_to_json(result, "outputs/result.json")
print(result)

Example 1 – Griptape Integration

Griptape provides tools for web scraping, summarization, and file management. Here’s how to wrap a Griptape agent into Crowe:


Example 2 – LangChain Integration

LangChain excels at LLM orchestration. Here’s how to integrate it into Crowe:


Example 3 – OpenAI Function Calling

OpenAI models (like GPT-4) can call external functions for advanced tasks.


Example 4 – Hugging Face Transformers

Hugging Face offers pre-trained NLP models for text generation, QA, and more.


Example 5 – Rasa Conversational Agent

Rasa is ideal for intent-based chatbots.


Example 6 – DialogFlow Integration

Google’s DialogFlow is useful for multi-turn conversations.


Example 7 – Custom API Agent

Crowe can wrap any REST/GraphQL API as an agent.


Summary of Crowe Integrations

  • Griptape → Web scraping + summarization workflows.

  • LangChain → LLM orchestration.

  • OpenAI Function Calling → Execute external APIs and functions.

  • Rasa → Intent-driven chatbots.

  • Hugging Face → Pre-trained transformer models.

  • DialogFlow → Multi-turn conversation flows.

  • Custom APIs → Any REST/GraphQL service as an agent.


Conclusion

Crowe’s modular Agent API makes it easy to plug in AI systems from any ecosystem. By following the above patterns, you can bring together multiple AI frameworks into a single, orchestrated environment, unlocking hybrid workflows that combine the strengths of each platform.

Last updated