Skip to main content

The RailTracks Framework for building resilient agentic systems in simple python

Project description

RailTracks

PyPI version Python Versions License PyPI - Downloads Docs GitHub stars Discord

Quick Start

Build your first agentic system in just a few steps. Start by building an agent which solves the "how many r's are in Strawberry?" problem.

Step 1: Install the Library

# Core library
pip install railtracks

# [Optional] CLI support for development and visualization
pip install railtracks-cli

Step 2: Define Your Modular Components

import railtracks as rt

# Create your tool
@rt.function_node
def number_of_characters(text: str, character_of_interest: str) -> int:
    return text.count(character_of_interest)

# Create your agent (connecting your LLM)
TextAnalyzer = rt.agent_node(
    tool_nodes={number_of_chars, num, CharacterCount},
    llm=rt.llm.OpenAILLM("gpt-4o"),
    system_message=(
        "You are a text analyzer. You will be given a text and return the number of characters, "
        "the number of words, and the number of occurrences of a specific character."
    ),
)

Step 3: Run Your Application

@rt.session
async def main():
    result = await rt.call(
        TextAnalyzer,
        rt.llm.MessageHistory([
            rt.llm.UserMessage("Hello world! This is a test of the RailTracks framework.")
        ])
    )
    print(result)

Step 4: [Optional] Visualize the Run

railtracks init
railtracks viz

And just like that, you're up and running. The possibilities are endless.


Contributing

We welcome contributions of all kinds! Check out our contributing guide to get started.

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.1.6.tar.gz (227.1 kB view details)

Uploaded Source

Built Distribution

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

railtracks-1.1.6-py3-none-any.whl (165.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for railtracks-1.1.6.tar.gz
Algorithm Hash digest
SHA256 98dee01bcfbf18e2d056084ce59e89fe4b7d186a12f81ac42618c837a6ce6a99
MD5 63c8dedbc9a19822898e60b307597885
BLAKE2b-256 586ebf2a0905959d63615b7632a3db9131d6f4985d99bcd7f426ce1d38421843

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for railtracks-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 520551f94db7f7ec2f76859b71a221e8593da20edd5073f8f79256b17a226fe0
MD5 3b4e3489e868b2622b213856acfbf1a1
BLAKE2b-256 cc5df5edb8d7157a32b29a86c497717c88dc5d9671efeb383003439b4e6f67b7

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