recursive_light
recursive_light
¶
Recursive Light backend using HTTP API.
Connects Marianne to Recursive Light Framework for TDF-aligned judgment and confidence scoring via HTTP API bridge.
Phase 3: Language Bridge implementation.
Classes¶
RecursiveLightBackend
¶
Bases: HttpxClientMixin, Backend
Execute prompts via Recursive Light HTTP API.
Uses httpx.AsyncClient to communicate with the Recursive Light server for TDF-aligned processing with confidence scoring, domain activations, and boundary state tracking.
The RL server provides dual-LLM processing: - LLM #1 (unconscious): Confidence assessment and domain activation - LLM #2 (conscious): Response generation with accumulated wisdom
Attributes:
| Name | Type | Description |
|---|---|---|
rl_endpoint |
Base URL for the Recursive Light API. |
|
user_id |
Unique identifier for this Marianne instance. |
|
timeout |
Request timeout in seconds. |
Initialize Recursive Light backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rl_endpoint
|
str
|
Base URL for the Recursive Light API server. Defaults to localhost:8080 for local development. |
'http://localhost:8080'
|
user_id
|
str | None
|
Unique identifier for this Marianne instance. Generates a UUID if not provided. |
None
|
timeout
|
float
|
Request timeout in seconds. Defaults to 30.0. |
30.0
|
Source code in src/marianne/backends/recursive_light.py
Attributes¶
Functions¶
from_config
classmethod
¶
Create backend from configuration.
Source code in src/marianne/backends/recursive_light.py
execute
async
¶
Execute a prompt through Recursive Light API.
Sends the prompt to RL's /api/process endpoint and parses the response for text output plus RL-specific metadata (confidence, domain activations, boundary states, quality).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt
|
str
|
The prompt to send to Recursive Light. |
required |
timeout_seconds
|
float | None
|
Per-call timeout override. RL backend uses its
own HTTP timeout from |
None
|
Returns:
| Type | Description |
|---|---|
ExecutionResult
|
ExecutionResult with output text and RL metadata populated. |
ExecutionResult
|
On connection errors, returns a failed result with graceful |
ExecutionResult
|
error handling (not raising exceptions). |
Source code in src/marianne/backends/recursive_light.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
health_check
async
¶
Check if Recursive Light server is available and responding.
Attempts to reach the RL health endpoint (or root) to verify connectivity before starting a job.
Returns:
| Type | Description |
|---|---|
bool
|
True if RL server is healthy and responding, False otherwise. |
Source code in src/marianne/backends/recursive_light.py
close
async
¶
Close the HTTP client connection.
Should be called when done using the backend to clean up resources.