Skip to main content

A flexible AI agent library with tool support

Project description

Fury Logo

Fury

Discord Tests

A flexible and powerful AI agent library for Python, designed to build agents with tool support, multimodal capabilities, and streaming responses.

Features

  • [New] Durable Memory: Persist named memory scopes, bind them to individual agents, and expose an airgapped memory tool.
  • Interruption and early stopping: Agents now use the Runner pattern, allowing them to be interrupted or stopped mid-generation.
  • Tool Support: Define and register custom tools (functions) that the agent can execute and parallel tool execution support.
  • Image and Voice inputs: Support for image and voice inputs (using Whisper for STT).
  • Text-to-Speech (TTS): Generate audio with NeuTTS via Agent.speak().
  • History Management: Use HistoryManager for auto-compaction support or StaticHistoryManager for strict fixed-size context trimming.

Installation

Install with uv:

uv add fury-sdk

Quick Start

from fury import Agent

agent = Agent(
    model="unsloth/GLM-4.6V-Flash-GGUF:Q8_0",
    system_prompt="You are a helpful assistant.",
)

print(agent.ask("Hello!", history=[]))
print(agent.ask("Hello!", history=[], model="another-model"))

Other examples:

History Management

Fury makes managing history limits easy by providing simple, built-in history managers. They are just list managers that monitor context utilization and trim or compact your list accordingly.

The standard HistoryManager will auto-compact your history as you add messages to it (summarise using an Agent) in a similar way to Claude Code, Codex and Pi.

from fury import HistoryManager

history_manager = HistoryManager(agent=agent)

# Add something to history like this:
await history_manager.add({"role": "user", "content": user_input})

# Use the history like this:
runner = agent.runner()
async for event in runner.chat(history_manager.history):
    # ...

See examples/chat.py for a full working example.

If you do not want auto-compaction and a hard history limit, use StaticHistoryManager:

from fury import StaticHistoryManager

history_manager = StaticHistoryManager(
    target_context_length=4096,
    history=[{"role": "system", "content": "You are helpful."}],
)

It keeps only the newest messages that fit in the target context length. See docs/example.md for a complete example.

Durable Memory

Fury can persist durable memory outside the current chat history using explicit named scopes. Pass memory_scope when constructing an agent and Fury will:

  • create or reuse a MemoryStore
  • inject the latest memory snapshot for that scope into the system prompt
  • register a memory tool bound only to that scope
from fury import Agent

agent = Agent(
    model="your-model-name",
    system_prompt="You are a helpful assistant.",
    memory_scope="my-project",
)

To share one backing store across multiple airgapped agents:

from fury import Agent, MemoryStore

store = MemoryStore(".fury/memory")

alpha = Agent(
    model="your-model-name",
    system_prompt="You help project alpha.",
    memory_store=store,
    memory_scope="project-alpha",
)

beta = Agent(
    model="your-model-name",
    system_prompt="You help project beta.",
    memory_store=store,
    memory_scope="project-beta",
)

See docs/memory.md for the full API.

Configuration Options

agent = Agent(
    model="your-model-name",
    system_prompt="You are a helpful assistant.",
    parallel_tool_calls=False,
    disable_stt=False,
    disable_tts=False,
    generation_params={
        "temperature": 0.2,
        "max_tokens": 512,
    },
)

# Disable reasoning stream content (default is False)
runner = agent.runner()
async for event in runner.chat(history, reasoning=False):
    ...

Defining Tools

You can give your agent tools to interact with the world. Tools are defined using the create_tool helper.

Input and output schemas help the model to correctly pass parameters through to the function. Fury will automatically prune any hallucinated parameters not defined in the input schema.

Learn more in the OpenAI guide

from fury import Agent, create_tool


def add(a: int, b: int):
    return {"result": a + b}

# Create the tool
add_tool = create_tool(
    id="add",
    description="Add two numbers together",
    execute=add,
    input_schema={
        "type": "object",
        "properties": {
            "a": {"type": "integer"},
            "b": {"type": "integer"},
        },
        "required": ["a", "b"],
    },
    output_schema={
        "type": "object",
        "properties": {"result": {"type": "integer"}},
        "required": ["result"],
    },
)

# Pass to agent
agent = Agent(..., tools=[add_tool])

If your tool accepts an emit parameter, Fury injects a runtime-only callback during execution so the tool can stream structured UI events during tool execution.

def search(query: str, emit):
    emit({"id": "search-1", "title": f"Searching for {query}", "type": "tool_call"})
    return {"query": query}

These arrive in the chat stream as event.tool_ui, separate from event.tool_call.

Coding Assistant Example

Check out examples/coding-assistant/coding_assistant.py for a full-featured example that includes:

  • Tools: File system operations (read, write, edit, bash).
  • Skills System: Loading specialized capabilities from SKILL.md files.
  • Memory System: Using durable memory plus SOUL.md for project context.
  • History Manager: Uses HistoryManager to summarize long conversations and save context window.

Build something neat.

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

fury_sdk-0.1.6.tar.gz (765.4 kB view details)

Uploaded Source

Built Distribution

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

fury_sdk-0.1.6-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file fury_sdk-0.1.6.tar.gz.

File metadata

  • Download URL: fury_sdk-0.1.6.tar.gz
  • Upload date:
  • Size: 765.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for fury_sdk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 535691de4d5ef5a9c2124249c4168aad7bf0fca3cc592f645a186cb8fe77967e
MD5 10d35a9a7f4314bf48b403fd1c15583a
BLAKE2b-256 e51085e010a47d11be7feb4035438bd2aefc284c088e8b1bf2d78b077307e18f

See more details on using hashes here.

File details

Details for the file fury_sdk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fury_sdk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for fury_sdk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 269b6770c75774e789e768556ccdca5afdb4399c2672e06a1dbbcbc391acd891
MD5 4e4f72fdbbb77f6b83b78fd1298ec423
BLAKE2b-256 1e3200f44502c36101595fa5581a543442a766b67d3d704ac7062d070bdf3afa

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