Skip to main content

Railtracks

Railtracks


PyPI Version Python Versions Monthly Downloads License GitHub Stars

What is Railtracks?

Railtracks is a Python framework for building agentic systems. Agent behavior, tools, and multi-step flows are defined entirely in standard Python using the control flow and abstractions you already know.

import railtracks as rt

# Define a tool (just a function!)
def get_weather(location: str) -> str:
    return f"It's sunny in {location}!"

# Create an agent with tools
agent = rt.agent_node(
    "Weather Assistant",
    tool_nodes=(rt.function_node(get_weather)),
    llm=rt.llm.OpenAILLM("gpt-4o"),
    system_message="You help users with weather information."
)

# Run it
flow = rt.Flow(name="Weather Flow", entry_point=agent)
result = flow.invoke("What's the weather in Paris?")
# or `await flow.ainvoke("What's the weather in Paris?)` in an async context
print(result.text)  # "Based on the current data, it's sunny in Paris!"

Execution order, branching, and looping are expressed using standard Python control flow.

Why Railtracks?

Pure Python

# Write agents like regular functions
@rt.function_node
def my_tool(text: str) -> str:
    return process(text)
  • No YAML, no DSLs, no magic strings
  • Compatible with standard debuggers
  • Full IDE autocomplete and type checking

Tool-First Architecture

# Any function becomes a tool
agent = rt.agent_node(
    "Assistant",
    tool_nodes=[my_tool, api_call]
)
  • Automatic function-to-tool conversion
  • Seamless API and database integration
  • MCP protocol support

Familiar Interface

# Native Async support
result = await rt.call(agent, query)
  • Standardized call interface, consistent with asyncio patterns
  • Built-in validation, error handling, and retries
  • Automatic parallelization management

Built-in Observability

Railtracks includes a visualizer for inspecting agent runs and evaluations in real-time, run completely locally with no signups required.

See the Observability documentation for setup and usage.

Quick Start

Installation
pip install railtracks 'railtracks[visual]'
Your First Agent
import railtracks as rt

# 1. Create tools (just functions with decorators!)
@rt.function_node
def count_characters(text: str, character: str) -> int:
    """Count occurrences of a character in text."""
    return text.count(character)

@rt.function_node
def word_count(text: str) -> int:
    """Count words in text."""
    return len(text.split())

# 2. Build an agent with tools
text_analyzer = rt.agent_node(
    "Text Analyzer",
    tool_nodes=(count_characters, word_count),
    llm=rt.llm.OpenAILLM("gpt-4o"),
    system_message="You analyze text using the available tools."
)

# 3. Use it to solve the classic "How many r's in strawberry?" problem
text_flow = rt.Flow(
  name="Text Analysis Flow",
  entry_point=text_analyzer
)

text_flow.invoke("How many 'r's are in 'strawberry'?")

LLM Support

Railtracks integrates with major model providers through a unified interface:

# OpenAI
rt.llm.OpenAILLM("gpt-5")

# Anthropic
rt.llm.AnthropicLLM("claude-4-6-sonnet")

# Local models
rt.llm.OllamaLLM("llama3")

Works with OpenAI, Anthropic, Google, Azure, and more. See the full provider list.

Contributing

Railtracks is developed in the open. Contributions, bug reports, and feature requests are welcome via GitHub Issues.

Quick Start Documentation Examples Join Discord


Licensed under MIT · Made by the Railtracks team

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

railtracks-1.4.5.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

railtracks-1.4.5-py3-none-any.whl (358.1 kB view details)

Uploaded Python 3

File details

Details for the file railtracks-1.4.5.tar.gz.

File metadata

  • Download URL: railtracks-1.4.5.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for railtracks-1.4.5.tar.gz
Algorithm Hash digest
SHA256 2b8bf1c2d671a2281c1462ed6669cca0dd333b789b4c30c8dc244ef465fa2522
MD5 defb3649d2679d11390efbbfaa6927c7
BLAKE2b-256 1a7f06667d79ce0ffe188d6456361a447c5f1a3160473cc184fb286bf9d13b34

See more details on using hashes here.

File details

Details for the file railtracks-1.4.5-py3-none-any.whl.

File metadata

  • Download URL: railtracks-1.4.5-py3-none-any.whl
  • Upload date:
  • Size: 358.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for railtracks-1.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0266b2ebe97fce4e9e05a7f1f05aa18ad65549c59f4ef1b9477bd95cba4b6d1a
MD5 35d915dfe4c7a461855dc5931d59236e
BLAKE2b-256 18dbd9893ee5081f6eb4b8a170460b32f56dd733a882a9a8a87932173e5770b5

See more details on using hashes here.

Release history Release notifications | RSS feed

1.115

2 files

1.4.7

2 files

1.4.6

2 files

This release

1.4.5 This release

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.10

2 files

1.3.9

2 files

1.3.8

2 files

1.3.7

2 files

1.3.6

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.28

2 files

1.1.27

2 files

1.1.26

2 files

1.1.25

2 files

1.1.24

2 files

1.1.23

2 files

1.1.22

2 files

1.1.21

2 files

1.1.20

2 files

1.1.19

2 files

1.1.18

2 files

1.1.17

2 files

1.1.16

2 files

1.1.14

2 files

1.1.11

2 files

1.1.10

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page