One line of code to make any application AI-controllable
RAIL is a universal bridge that connects any application (C#, C++, Python, Node.js) to any LLM (GPT, Claude, Gemini). Instead of rewriting your application, you add one line of code and the AI can call your methods directly.
| Project | Purpose | Language |
|---|---|---|
| RailOrchestrator | Main AI application (UI + LLM routing) | C# / WPF |
| RailBridge.Native | Native DLL for cross-language IPC | C# (Native AOT) |
| RailSDK.Universal | Client SDK for .NET apps | C# (.NET Standard) |
| RailSDK | Analysis & manifest generation tools | C# |
| RailSDK-Cpp | Client SDK for C++ apps | C++ |
| RailSDK-Python | Client SDK for Python apps | Python |
| RailSDK-Node | Client SDK for Node.js apps | TypeScript |
| RailStudio | Visual tool for scanning/analyzing apps | C# / WPF |
| ConvertedProjectExample | Example applications | C# |
The Brain - Main application that users interact with.
- WPF desktop application (.NET 9)
- Connects to LLMs (Gemini, OpenAI, Anthropic, Claude)
- ReAct agent loop for multi-step reasoning
- Hosts the Named Pipe server for client connections
- Manages assets (Chips) and tool routing
Key files:
Services/Host/HostService.cs- Named Pipe serverServices/LLMService.cs- LLM API integrationServices/ReAct/ReActOrchestrator.cs- Agent loop
The Bridge - Native DLL that enables cross-language communication.
- Compiled with Native AOT for C-ABI compatibility
- Exposes functions callable from any language:
RAIL_Ignite()- Connect to host
- Uses Named Pipes for IPC
Target: Python, C++, Node.js, Rust, Go
The .NET SDK - Client library for C# applications.
- .NET Standard 2.0 (compatible with .NET Framework 4.6.1+)
- Simple API:
RailEngine.Ignite(this) - Auto-discovers methods via reflection
- Loads
RailBridge.dllfor communication
Usage:
// In App.xaml.cs
RailEngine.Ignite(this);The Toolkit - Assembly scanning and manifest generation.
Contains:
RuntimeRegistry- Detect .NET / Native binariesAssemblyScanner- Extract methods from DLLsCompositeManifest- Multi-module manifest formatDependencyAnalyzer- Analyze project dependenciesSolutionScanner- Scan entire .sln solutions
Used by: RailStudio, RailOrchestrator
The C++ SDK - Enable C++ applications to connect.
- CMake-based build system
- Loads
RailBridge.dllviaLoadLibrary - Callback-based command execution
- Supports both x64 and x86 builds
Build:
build_x64.bat # 64-bit
build_x86.bat # 32-bit (legacy apps)Usage:
Rail::ignite("MyApp", manifestJson, onCommand);The Python SDK - Enable Python scripts to connect.
- Uses
ctypesto loadRailBridge.dll - Decorator-based method registration
- Simple API matching other SDKs
Usage:
from rail import RailEngine
engine = RailEngine()
engine.ignite([MyService()])The Node.js SDK - Enable TypeScript/JavaScript apps to connect.
- Uses
ffi-napifor native bridge access - TypeScript types included
- Promise-based API
Usage:
import { RailEngine } from 'rail-sdk';
engine.ignite([new MyService()]);The Visual Tool - Scan and analyze applications.
- EXE/DLL to analyzer
- Auto-generates
rail.manifest.json - Visualizes dependencies
- Solution-wide scanning
Use case: Preparing legacy apps for Rail integration
Example applications showing SDK integration.
| Example | Description |
|---|---|
AgentTest |
Simple WPF app with customer database |
WorkflowDemo |
Workflow automation example |
Manifest Here you can find Manifest folder with all the "rail.manifest.json" already created for this example application
When converting your application to be AI-controllable, here's exactly what you need:
| Language | What to Add | Automatically Included | Notes |
|---|---|---|---|
| C# (.NET) | RailSDK.Universal.dll |
RailBridge.dll (auto-copied) |
One reference, everything included |
| C++ (Modern) | rail_sdk.dll + RailBridge.dll |
β | RTTR reflection, auto method discovery |
| C++ (Legacy) | rail_sdk.dll + RailBridge.dll |
β | Custom dispatcher, manual routing |
| Python | RailBridge.dll + rail package |
β | Load via ctypes |
| Node.js | RailBridge.dll + rail-sdk npm |
β | Load via ffi-napi |
When you add RailSDK.Universal, the native bridge is automatically copied to your output:
π bin/Debug/net8.0/
βββ YourApp.exe
βββ RailSDK.Universal.dll β You add this reference
βββ RailBridge.dll β Copied automatically!
βββ rail.manifest.json β You create this
How to add:
<PackageReference Include="RailSDK.Universal" Version="2.0.0" />C++ has two integration modes depending on your codebase:
For new applications or codebases that support C++17:
// Register your classes with RTTR macros
RTTR_REGISTRATION {
rttr::registration::class_<OrderManager>("OrderManager")
.method("CreateOrder", &OrderManager::CreateOrder);
}
// SDK auto-discovers methods
rail::RegisterInstance("OrderManager", &myManager);
rail::Ignite("MyApp");Files needed:
π YourApp/
βββ YourApp.exe
βββ rail_sdk.dll β C++ wrapper (includes RTTR)
βββ RailBridge.dll β Native IPC bridge
βββ rail.manifest.json β Auto-generated
For legacy applications that can't use C++17 or RTTR (e.g., games, old codebases):
#define RAIL_NO_RTTR // Disable RTTR
// Define your own command router
std::string MyDispatcher(const std::string& json) {
if (json.find("MovePlayer") != std::string::npos) {
MovePlayer();
return "{\"result\": \"success\"}";
}
return "{\"error\": \"unknown\"}";
}
// Register and connect
rail::SetCustomDispatcher(MyDispatcher);
rail::Ignite("MyLegacyApp", "1.0", customManifest);Files needed:
π YourApp/
βββ YourApp.exe
βββ rail_sdk.dll β C++ wrapper (no RTTR)
βββ RailBridge.dll β Native IPC bridge
βββ rail.manifest.json β You write this manually
Real Examples: Notepad++ and Doom were integrated using Option B (Custom Dispatcher) because their codebases couldn't support RTTR.
π YourProject/
βββ main.py (or index.ts)
βββ RailBridge.dll β Copy manually
βββ rail.manifest.json β You create this
Install the wrapper package that handles ctypes/ffi calls for you.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RailOrchestrator β
β (Main AI Application) β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββ β
β β LLM APIs β β HostService β β AssetService β β
β β (Gemini, β β (Named Pipe β β (Chip/Manifestβ β
β β OpenAI) β β Server) β β Discovery) β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ βββββββββββββββββ β
βββββββββββΌβββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β β
β Named Pipe: "RailHost"
β β
βββββββ΄βββββββββββββββββββ΄ββββββββββββββββββββββ
β RailBridge.Native β
β (C-ABI Native DLL) β
ββββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
ββββββββΌβββββββ ββββββββΌβββββββ ββββββββΌβββββββ
β RailSDK β β RailSDK β β RailSDK β
β .Universal β β -Cpp β β -Python β
β (C# Apps) β β (C++ Apps) β β (Python) β
ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
ββββββββΌβββββββ ββββββββΌβββββββ ββββββββΌβββββββ
β Your C# β β Your C++ β β Your Python β
β App β β App β β Script β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
RailOrchestrator
βββ uses β RailSDK (RailFactory.Core) for manifest parsing
RailSDK.Universal
βββ loads β RailBridge.Native (DLL)
RailSDK-Cpp / RailSDK-Python / RailSDK-Node
βββ load β RailBridge.Native (DLL)
RailStudio
βββ uses β RailSDK (RailFactory.Core) for scanning
// 1. Create your service
public class CustomerService
{
public Customer GetCustomer(int id) => Database.Find(id);
public void CreateCustomer(string name, string email) { ... }
}
// 2. Add one line in App.xaml.cs
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
RailEngine.Ignite(this);
}
// 3. Create rail.manifest.json (or use RailStudio)// Define callback
const char* OnCommand(const char* json) {
auto cmd = ParseJson(json);
if (cmd.method == "MoveMachine") {
Machine::Move(cmd.args["x"], cmd.args["y"]);
return R"({"result": "OK"})";
}
return R"({"error": "Unknown"})";
}
// Connect
rail::ignite("CNCController", manifest, OnCommand);class DataProcessor:
def analyze_data(self, file_path: str) -> dict:
return {"rows": 1000, "status": "processed"}
engine = RailEngine()
engine.ignite([DataProcessor()])
engine.wait()With apps connected, ask in natural language:
"Create a customer named John Smith with email john@example.com"
β AI calls CustomerService.CreateCustomer("John Smith", "john@example.com")
"Move the machine to position X=100, Y=200"
β AI calls CNCController.MoveMachine(100, 200)
- Run RailOrchestrator - The main AI interface
- Connect your app - Add SDK and call
Ignite() - Ask AI - Natural language commands execute your code
RAIL Protocol - Bridging Legacy Applications and AI

