Skip to main content

Transform LLM Agents into High-Performance Engines with DAG optimization

Project description

Tygent Python Package

Transform LLM Agents into High-Performance Engines with DAG optimization.

Installation

pip install tygent

Overview

Tygent converts agent-generated plans into typed Directed Acyclic Graphs (DAGs) for optimized execution through critical path analysis. This enables parallel execution of independent tasks and more efficient use of resources.

Key Features

  • DAG Optimization: Transform sequential plans into parallel execution graphs
  • Typed Execution: Strong typing for inputs and outputs between nodes
  • Critical Path Analysis: Identify and optimize the critical execution path
  • Constraint-Aware Scheduling: Schedule tasks based on resource constraints
  • Dynamic Runtime Adaptation: Adapt execution based on intermediate results

Quick Start

from tygent import DAG, ToolNode, LLMNode, Scheduler

# Create a DAG for your workflow
dag = DAG("my_workflow")

# Define tool functions
async def search_data(inputs):
    # Implementation
    return {"results": f"Search results for {inputs.get('query')}"}

async def extract_info(inputs):
    # Implementation
    return {"extracted": f"Extracted from {inputs.get('results')}"}

# Add nodes to the DAG
dag.add_node(ToolNode("search", search_data))
dag.add_node(ToolNode("extract", extract_info))
dag.add_node(LLMNode(
    "analyze", 
    model="gpt-4o",
    prompt_template="Analyze this data: {extracted}"
))

# Define execution flow with dependencies
dag.add_edge("search", "extract")
dag.add_edge("extract", "analyze")

# Create a scheduler to execute the DAG
scheduler = Scheduler(dag)

# Execute the workflow
import asyncio
async def run():
    result = await scheduler.execute({"query": "What is the latest news about AI?"})
    print(result)

asyncio.run(run())

Documentation

For detailed documentation and more examples, visit tygent.ai or check out the examples repository.

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

tygent-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

tygent-0.1.0-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file tygent-0.1.0.tar.gz.

File metadata

  • Download URL: tygent-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for tygent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3ad1ba5cc4d109d957ac5767998c144f1d6145d510f598fbe34b4d9542258d05
MD5 c47b71e66cb07ffd5ec4096544693a2a
BLAKE2b-256 ea21bb3786ffba2357fddc38da73b094ab7e532046f76d531422ab19e36dbae7

See more details on using hashes here.

File details

Details for the file tygent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tygent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tygent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef9f02ec6697b2e257a990b527a378f8b423bfc429f0cbca9146b4bcd94bdd71
MD5 8e964f9361537b1330bca6aa133868dc
BLAKE2b-256 4328239c11882d3934a7acc7c8587e18e56342235915f3f09a01e2b37fc8aeec

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