Skip to main content

Coffee Agent Framework

A Python framework for building and managing AI agent workflows with support for tools, teams, and complex interactions.

Installation

pip install coffee-agent-kit

You can find the package on PyPI.

Examples

See ./example.py

Interacting with the Coffee API

from coffee.api_client import CoffeeClient
from coffee.config import config
config.api_client = CoffeeClient(
    api_key=YOUR_API_KEY,
)

image

image

Quickstart

from coffee import Agent, CoffeeClient, config
from coffee.models import DEFAULT_MODEL

# Configure API client
config.api_client = CoffeeClient(
    api_key="your_api_key_here", base_url="https://coffee-sdk-api.fly.dev"
)
# Create a basic agent
research_agent = Agent(
    name="ResearchAgent",
    instructions=[
        "You are a research assistant specialized in web information gathering"
    ],
    tools=["duckduckgo", "web_browser"],
    model=DEFAULT_MODEL,
)
# Simple interaction
research_agent.print_message("What's the latest news about AI advancements?")

Core Concepts

Agents

Agents are autonomous units with specific capabilities:

class Agent:
    def message(self, msg: str, only_show_response: bool = True):
        ...

    def print_message(self, msg: str):
        ...

Tools

Built-in tools provide specialized capabilities:

BuiltinTools = Literal[
    "web3_essentials_tools",
    "solana_tools",
    "duckduckgo",
    "web_browser",
    "wikipedia_tools",
    # and lots more
]

Workflows

Chain multiple agents into complex workflows:

web3_workflow = (
    Workflow.build(
        Task(description="Web search", assignee=search_agent)
    )
    .add_task(Task(description="Wiki research", assignee=wiki_agent))
    .add_task(Task(description="Web3 analysis", assignee=web3_agent))
)

web3_workflow.execute_and_print("Latest blockchain trends")

Key Features

Multi-Agent Collaboration

team = Agent(
    name="TeamLead",
    instructions=["Coordinate team activities"],
    team=[research_agent, writer_agent, analysis_agent]
)

Custom Tools

Register or Purchase custom tools on the Coffee Website and use them in your agents.

class RemoteTool(BaseModel):
    name: str
    url: str
    args: dict[str, PluginArgType]
    instructions: str

    def register_tool(self):
        # Registration logic
        pass

Model Support

class OpenAI(Model):
    id: str = "gpt-4o"
    name: str = "OpenAIChat"
    provider: str = "OpenAI"

class Claude(Model):
    id: str = "claude-3-5-sonnet-20241022"
    provider: str = "Anthropic"

Advanced Configuration

Environment Setup

# Configure logging
from coffee.log import logger
logger.setLevel(logging.DEBUG)

# Custom client configuration
config.api_client = CoffeeClient(
    api_key="your_key"
)

Examples

Blog Writing Workflow

blog_workflow = Workflow.build(
    Task(description="Gather research", assignee=research_agent)
).add_task(
    Task(description="Write article", assignee=writer_agent)
)

blog_workflow.execute_and_print("Generative AI in healthcare")

Metadata

Release files for coffee-agent-kit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coffee-agent-kit 0.1.0
File Size Uploaded Provenance
coffee_agent_kit-0.1.0.tar.gz 9.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for coffee-agent-kit 0.1.0
File Interpreter ABI Platform
coffee_agent_kit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / coffee_agent_kit-0.1.0.tar.gz

Download URL coffee_agent_kit-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2413972747e71c4c939119d9ac3d95d9e7f1db8fe20a2f755503a1c3dd9af4b3
BLAKE2b-256 checksum
How to use checksums
7a438c25d64a13e23fa7513d2e4198176836ce0bf1bdc197100fd967411b2f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / coffee_agent_kit-0.1.0-py3-none-any.whl

Download URL coffee_agent_kit-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fc86c55d87a3794c721d36a50cdabfaef071371d9e19c7a94e9f8685af799cd
BLAKE2b-256 checksum
How to use checksums
727cc45cbc0febd8c0c83b1d5cb1a0a9de30d838e8217e62f8dc6ea92d6a9bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Security for coffee-agent-kit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page