Skip to main content

Overview

Wrap your LangChain, OpenAI, Anthropic, or LlamaIndex agent in one line — or build a custom agent from scratch. Deploy and start streaming responses to your users.
Building from scratch? Continue below to create a custom agent.

Installation

pip install reminix-runtime

Custom Agent Example

Create agents using the @agent decorator. Use the template option for standard I/O shapes (e.g. prompt, chat, task, rag, thread):
from reminix_runtime import agent, serve, Message

# Task-oriented agent (default prompt template)
@agent
async def echo(prompt: str) -> str:
    """A simple echo agent."""
    return f"Echo: {prompt}"

# Chat agent (chat template: messages in, string out)
@agent(template="chat")
async def assistant(messages: list[Message]) -> str:
    """A conversational assistant."""
    last_message = messages[-1].content if messages else ""
    return f"You said: {last_message}"

# Run locally for testing
if __name__ == "__main__":
    serve(agents=[echo, assistant], port=8080)

Agent Structure

An agent consists of:
ComponentDescription
nameUnique identifier (from function name or override)
descriptionFrom docstring or explicit parameter
input schemaInferred from type hints (or explicit)
handlerThe handler function
@agent(name="my-agent", description="A helpful assistant")
async def my_agent(prompt: str) -> str:
    return f"Processed: {prompt}"

@agent(template="chat")
async def chat_bot(messages: list[Message]) -> str:
    return "Hello!"

Running Locally

Test your agent before deploying:
# Start a local server
serve(agents=[echo, assistant], port=8080)
Then test with the SDK:
from reminix import Reminix

client = Reminix(base_url="http://localhost:8080")

# Test task agent
response = client.agents.invoke("echo", prompt="Hello!")
print(response["content"])  # "Echo: Hello!"

# Test chat agent
response = client.agents.invoke(
    "assistant",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response["message"]["content"])  # "You said: Hello!"

Project Structure

Recommended structure for your agent project:
my-agent
main.py
pyproject.toml
pyproject.toml
[project]
name = "my-agent"
requires-python = ">=3.10"
dependencies = [
    "reminix-runtime",
]
Prefer module-based projects? Add a start script — see Project Configuration for details.

Next Steps