Skip to main content

DUKE Agents - Advanced AI Agent Framework with IPO Architecture

Project description

DUKE Agents

PyPI version Python Support License: MIT Documentation Status

DUKE Agents is an advanced AI agent framework implementing the IPO (Input-Process-Output) architecture with enriched memory and feedback loops. It provides autonomous agents powered by Mistral LLMs for complex task execution.

🚀 Features

  • IPO Architecture: Structured Input-Process-Output workflow with memory persistence
  • Multiple Agent Types: AtomicAgent for simple tasks, CodeActAgent for code generation and execution
  • Mistral Integration: Native support for Mistral and Codestral models
  • Memory Management: Rich workflow memory with feedback loops
  • Auto-correction: Built-in retry logic with satisfaction scoring
  • Flexible Orchestration: Linear and LLM-driven workflow execution
  • Type Safety: Full Pydantic models for type validation

📦 Installation

pip install duke-agents

Prerequisites

🔧 Quick Start

Basic Usage

from duke_agents import AtomicAgent, ContextManager, Orchestrator
from duke_agents.models import AtomicInput

# Set your Mistral API key
import os
os.environ["MISTRAL_API_KEY"] = "your-api-key"

# Initialize context manager
context = ContextManager("Process customer data")

# Create orchestrator
orchestrator = Orchestrator(context)

# Create and register an agent
agent = AtomicAgent("data_processor")
orchestrator.register_agent(agent)

# Define workflow
workflow = [{
    'agent': 'data_processor',
    'input_type': 'atomic',
    'input_data': {
        'task_id': 'task_001',
        'parameters': {'data': 'customer info'}
    }
}]

# Execute workflow
results = orchestrator.execute_linear_workflow(workflow)

Code Generation Example

from duke_agents import CodeActAgent, ContextManager, Orchestrator

# Initialize
context = ContextManager("Generate data analysis code")
orchestrator = Orchestrator(context)

# Create code generation agent
code_agent = CodeActAgent("analyst")
orchestrator.register_agent(code_agent)

# Execute
workflow = [{
    'agent': 'analyst',
    'input_type': 'codeact',
    'input_data': {
        'prompt': 'Create a function to analyze sales data and return top 5 products'
    }
}]

results = orchestrator.execute_linear_workflow(workflow)

# Generated code is in results[0].generated_code
if results[0].success:
    print(f"Generated code:\n{results[0].generated_code}")
    print(f"Execution result: {results[0].execution_result}")

📚 Documentation

Full documentation is available at duke-agents.readthedocs.io.

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide first.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Built with Mistral AI models
  • Implements IPO architecture for robust agent workflows

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

duke_agents-1.0.0.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

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

duke_agents-1.0.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file duke_agents-1.0.0.tar.gz.

File metadata

  • Download URL: duke_agents-1.0.0.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for duke_agents-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f297075539577444ee09b0eb66bbeb206defa1f5c38f2d4faf6b78745ab6cc96
MD5 d9608b284b5fad29f4ebd9acd13d1bc6
BLAKE2b-256 be9e3dabbb552cc90333799495ba6b05cf1015be63c6d76a92434b96d3cd24e9

See more details on using hashes here.

File details

Details for the file duke_agents-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: duke_agents-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for duke_agents-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1eed3ac19d5ce09a386e53e41c2b3cf5dda38314b7aa9eddc51d7bc331522a46
MD5 8ebe8a1353f4c1db4397021118114223
BLAKE2b-256 336ec9b5e8a5b81388be736dab0471e25520707d89b54911730c82be15630468

See more details on using hashes here.

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