Skip to main content

The fastest and easiest way to build AI agent applications

Project description

PyPI

Hypertic is the fastest and easiest way to build AI agent applications. It provides a clean, simple interface for connecting models, tools, vector databases, memory, and more.

Key Features:

  1. Tools: Create custom tools with Python functions or connect to MCP servers
  2. Memory: Store conversation history with in-memory, PostgreSQL, MongoDB, or Redis backends
  3. Retriever: Connect agent to your documents and data for RAG capabilities
  4. Structured Output: Get validated, structured responses using Pydantic models or schemas
  5. Guardrails: Add safety and validation rules to control agent behavior

Check out the examples to see how Hypertic works, and visit our documentation to learn more.

Get Started

To get started, set up your Python environment (Python 3.10 or newer required), and then install the Hypertic package.

venv

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install hypertic

For specific model providers, install the corresponding packages:

pip install hypertic[openai]          # For OpenAI
pip install hypertic[anthropic]       # For Anthropic
pip install hypertic[google-genai]    # For Google Gemini

uv

If you're familiar with uv, installing the package would be even easier:

uv init
uv add hypertic

For specific model providers:

uv add openai          # For OpenAI
uv add anthropic       # For Anthropic
uv add google-genai    # For Google Gemini

Quick Start

Sync (non-streaming):

Use run() for synchronous, non-streaming responses. This returns the complete response after the agent finishes processing:

from hypertic.agents import Agent
from hypertic.models import OpenAIChat
from hypertic.tools import tool

# Define a tool
@tool
def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"Sunny, 72°F in {city}"

# Create agent
model = OpenAIChat(model="gpt-4")
agent = Agent(
    model=model,
    tools=[get_weather],
    instructions="You are a helpful assistant."
)

# Use it
response = agent.run("What's the weather in San Francisco?")
print(response.content)

Sync (streaming):

Use stream() for synchronous streaming. This yields events in real-time as the agent generates responses, improving user experience for longer outputs:

from hypertic.agents import Agent
from hypertic.models import OpenAIChat
from hypertic.tools import tool

# Define a tool
@tool
def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"Sunny, 72°F in {city}"

# Create agent
model = OpenAIChat(model="gpt-4")
agent = Agent(
    model=model,
    tools=[get_weather],
    instructions="You are a helpful assistant."
)

# Stream responses in real-time
for event in agent.stream("What's the weather in San Francisco?"):
    if event.type == "content":
        print(event.content, end="", flush=True)

Async (non-streaming):

Use arun() for asynchronous, non-streaming responses. This is ideal for concurrent operations and non-blocking I/O:

import asyncio
from hypertic.agents import Agent
from hypertic.models import OpenAIChat
from hypertic.tools import tool

# Define a tool
@tool
def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"Sunny, 72°F in {city}"

# Create agent
model = OpenAIChat(model="gpt-4")
agent = Agent(
    model=model,
    tools=[get_weather],
    instructions="You are a helpful assistant."
)

async def main():
    response = await agent.arun("What's the weather in San Francisco?")
    print(response.content)

asyncio.run(main())

Async (streaming):

Use astream() for asynchronous streaming. This combines the benefits of async operations with real-time response streaming:

import asyncio
from hypertic.agents import Agent
from hypertic.models import OpenAIChat
from hypertic.tools import tool

# Define a tool
@tool
def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"Sunny, 72°F in {city}"

# Create agent
model = OpenAIChat(model="gpt-4")
agent = Agent(
    model=model,
    tools=[get_weather],
    instructions="You are a helpful assistant."
)

async def main():
    async for event in agent.astream("What's the weather in San Francisco?"):
        if event.type == "content":
            print(event.content, end="", flush=True)

asyncio.run(main())

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

License

This project is licensed under the Apache License 2.0.

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

hypertic-0.0.4.tar.gz (704.4 kB view details)

Uploaded Source

Built Distribution

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

hypertic-0.0.4-py3-none-any.whl (172.3 kB view details)

Uploaded Python 3

File details

Details for the file hypertic-0.0.4.tar.gz.

File metadata

  • Download URL: hypertic-0.0.4.tar.gz
  • Upload date:
  • Size: 704.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hypertic-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e430ff39bd44cb54cef4508a30eac2498f546f0bd316586fc36da695bdc12f25
MD5 dc34ecd5d0d4de36861fbfc23e5c78fc
BLAKE2b-256 95da7c4a64284080240855641a952c33cd407ce5982df9db8041c16711bf5193

See more details on using hashes here.

Provenance

The following attestation bundles were made for hypertic-0.0.4.tar.gz:

Publisher: publish.yml on hypertic-ai/hypertic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hypertic-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: hypertic-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 172.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hypertic-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 076a457b18d02fa06594c42369bf9f0731c37cd235344cf99d98c1edec186b75
MD5 4c521b358b6ba30f27f5ce5a8670a9ea
BLAKE2b-256 459de6cf9ade16691ebe44b6f540e4f54324d40618f2163175507a4d5940ac2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hypertic-0.0.4-py3-none-any.whl:

Publisher: publish.yml on hypertic-ai/hypertic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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