Skip to main content

The Railtracks Framework for building resilient agentic systems in simple python

Project description

Railtracks

Railtracks Space Banner

Agents in minutes • Zero config • Local visualization • Pure Python


Quick Start Documentation Examples Join Discord

PyPI Version Python Versions Monthly Downloads License GitHub Stars


✨ What is Railtracks?

Easy agent building, for no one but YOU: Create deployable complex agents using simple, Pythonic style interface with natural control flow.


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
result = await rt.call(agent, "What's the weather in Paris?")
print(result.text)  # "Based on the current data, it's sunny in Paris!"

That's it. No complex configurations, no learning proprietary syntax. Just Python.


🎯 Why Railtracks?

🐍 Pure Python Experience

# Write agents like regular functions
@rt.function_node
def my_tool(text: str) -> str:
    return process(text)
  • ✅ No YAML, no DSLs, no magic strings
  • ✅ Use your existing debugging tools
  • ✅ IDE autocomplete & type checking

🔧 Tool-First Architecture

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

Look Familiar?

# Smart parallelization built-in 
# with interface similar to asyncio
result = await rt.call(agent, query)
  • ✅ Easy to learn standardized interface
  • ✅ Built-in validation, error handling & retries
  • ✅ Auto-parallelization management

👁️ Transparent by Design

railtracks viz  # See everything
  • ✅ Real-time execution visualization
  • ✅ Complete execution history
  • ✅ Debug like regular Python code

🚀 Quick Start

📦 Installation
pip install railtracks railtracks[cli]
⚡ Your First Agent in 5 Min
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'?")
📊 Visualize Agent locally with a simple command
railtracks init  # Setup visualization (one-time)
railtracks viz   # See your agent in action

Railtracks Visualizer
🔍 See every step of your agent's execution in real-time


💡 Real-World Examples

🔍 Multi-Agent Research System
# Research coordinator that uses specialized agents
researcher = rt.agent_node("Researcher", tool_nodes=(web_search, summarize))
analyst = rt.agent_node("Analyst", tool_nodes=(analyze_data, create_charts))
writer = rt.agent_node("Writer", tool_nodes=(draft_report, format_document))

coordinator = rt.agent_node(
    "Research Coordinator",
    tool_nodes=(researcher, analyst, writer),  # Agents as tools!
    system_message="Coordinate research tasks between specialists."
)
🔄 Complex Workflows Made Simple
# Customer service system with context sharing
async def handle_customer_request(query: str):
    with rt.Session() as session:
        # Technical support first
        technical_result = await rt.call(technical_agent, query)
        
        # Share context with billing if needed
        if "billing" in technical_result.text.lower():
            session.context["technical_notes"] = technical_result.text
            billing_result = await rt.call(billing_agent, query)
            return billing_result
        
        return technical_result

🌟 What Makes Railtracks Special?

A lightweight agentic LLM framework for building modular, multi-LLM workflows with a focus on simplicity and developer experience.

Feature Railtracks
🐍 Python-first, no DSL
📊 Built-in visualization
⚡ Zero setup overhead
🔄 LLM-agnostic
🎯 Pythonic style

🔗 Universal LLM Support

Switch between providers effortlessly:

# OpenAI
rt.llm.OpenAILLM("gpt-4o")

# Anthropic
rt.llm.AnthropicLLM("claude-3-5-sonnet")

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

Works with OpenAI, Anthropic, Google, Azure, and more! Check out our neatly crafted docs.

🛠️ Powerful Features

📦 Rich Tool Ecosystem

Use existing tools or create your own:

  • Built in Tools RAG, CoT, etc.
  • Functions → Tools automatically
  • MCP Integration as client or as server
  • Agents as Tools → agent cluster

🔍 Built-in Observability

Debug and monitor with ease:

  • ✅ Real-time execution graphs
  • ✅ Performance metrics
  • ✅ Error tracking & debugging
  • ✅ Local visualization
  • ✅ Session management
  • No signup required!

📚 Learn More

Documentation
Documentation

Complete guides & API reference
Quickstart
Quickstart

Up and running in 5 minutes
Examples
Examples

Real-world implementations
Discord
Discord

Get help & share creations
Contributing
Contributing

Help make us better

🚀 Ready to Build?

pip install railtracks[cli]

✨ Join developers across the world building the future with AI agents


Star this repo



You grow, we grow - Railtracks will expand with your ambitions.



Made with lots of ❤️ and ☕ by the ◊Railtracks◊ team • Licensed under MIT • Report BugRequest Feature

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

railtracks-1.2.5.tar.gz (9.5 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.2.5-py3-none-any.whl (223.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for railtracks-1.2.5.tar.gz
Algorithm Hash digest
SHA256 7760769b1707a55e925bbdec8a00bb56fc5f0cc141725857e2a0f6bbeae78482
MD5 8594b828684f951d02a68f9794e429f2
BLAKE2b-256 33d39f7a649ba361913181547aa058c4909aeddb9082fcb6b9e358b054fb5183

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for railtracks-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a8653ffc20bba6d969a78efbd05066a92317ae8851d9f4fb1b60568bc6c6648
MD5 3f4cf8baf0be439a5047b6f6424ba359
BLAKE2b-256 bc28ed9e1e9ce55a8ffeadc76d31ca8cbaba23e6b8ef715d7e038aafd12a6c09

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