Railtracks
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:
"""Get the current weather for a location."""
return f"It's sunny in {location}!"
# Create an agent with tools
agent = rt.agent_node(
"Weather Assistant",
# Alternatively, use @rt.function_node at def time
tool_nodes=[rt.function_node(get_weather)],
llm=rt.llm.OpenAILLM("gpt-5.4-mini"),
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)
|
Tool-First Architecture# Any function becomes a tool
agent = rt.agent_node("Assistant", tool_nodes=[my_tool, api_call])
|
Familiar Interface# Native Async support
result = await rt.call(agent, query)
|
Built-in ObservabilityRailtracks 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[visual]'
Set your API key
Railtracks loads a local .env file on import, save your provider keys there:
echo "OPENAI_API_KEY=sk-..." >> .env
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-5.4-mini"),
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)
result = text_flow.invoke("How many 'r's are in 'strawberry'?")
print(result.text)
LLM Support
Railtracks integrates with major model providers through a unified interface:
# OpenAI
rt.llm.OpenAILLM("gpt-5.4-mini")
# Anthropic
rt.llm.AnthropicLLM("claude-sonnet-5")
# 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.
Licensed under MIT · Made by the Railtracks team
Metadata
Release files for railtracks 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| railtracks-1.5.0.tar.gz | 300.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| railtracks-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 720.4 kB
Release files / railtracks-1.5.0.tar.gz
| Download URL | railtracks-1.5.0.tar.gz |
|---|---|
| Size | 300.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8c30607ae98ec5b862d3dad41c11ccbbbf523fcc1d8bb5d4ff5afbb8f7e8222
|
|
BLAKE2b-256 checksum How to use checksums |
4e8673d721e0c035c8f045265f8bdb6ce23816cefd03e4f70aacf69bb5aaea43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / railtracks-1.5.0-py3-none-any.whl
| Download URL | railtracks-1.5.0-py3-none-any.whl |
|---|---|
| Size | 420.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0965a556715d61fc918c77f9d1b612e920a6c07f25a6295f2864a3426523c95d
|
|
BLAKE2b-256 checksum How to use checksums |
5eaea5afc53aeb08f99f385959334141b51cb253a7bc302f2f2c85130390c588
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|