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.4.tar.gz (227.2 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.4-py3-none-any.whl (165.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for railtracks-1.1.4.tar.gz
Algorithm Hash digest
SHA256 81c0e3b25e8e613c2c93e64c4c562eb8cf49936258d7192f1b7ccb8531c17b37
MD5 91c8ee704bd7b92e9c340a28d7f3c725
BLAKE2b-256 3f381fea94017b56a9fb88db40f30bb4b79bdb35a2eeefbe0f0d222b0d64b2e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: railtracks-1.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 74d7798eb7c3e15d7428961694538fb2efaa0fe15a654098135b3794050ac979
MD5 1b2325731b3e30c2e96ede2da89fc5a9
BLAKE2b-256 4e3333ce1f3e3c32240ed858f82b582618dd303586113ea7887ac2e477cb3311

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