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.5.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.5-py3-none-any.whl (165.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: railtracks-1.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 14067234e786d3a7a9bf810443ce5bc80957d662deaeacdc3bc7eeb5b6666a11
MD5 659545b014cbdb57bee304b562c8e5ae
BLAKE2b-256 335e523d0bc47c3ef919956ddd869e108411c1bdf303ba027c0d88bae39920f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: railtracks-1.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3a88798b6c17ebf0b0d00bd59b991f92ed8191f36659e9d1a7076649fead45f7
MD5 75e7c63de8443cbd051b6a9c8e0f1f2c
BLAKE2b-256 47491d7ef0804d324c33bbdd79762c0323568f3ef6e1189c4f4457bdacc0e36c

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