robot_lab-durable 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.envrc +2 -2
- data/examples/day_trader_lib/predictor.rb +13 -9
- data/lib/robot_lab/durable/version.rb +1 -1
- data/lib/robot_lab/recall_knowledge.rb +1 -1
- data/lib/robot_lab/record_knowledge.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5d6b04770207ea0c384fbf75927ec8245e95d159970a218998439b9d2b76756
|
|
4
|
+
data.tar.gz: 7d023954515d71306244b102bd7848f9e435d9418772c6319864c74420173d72
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bbed76fad21404c41898485c037582a5bca595501e3253a7e38da32d349417d7deadefa0c19398fd9e3763db8eaa2a9b87920227d8762fb43001f2197932f5f
|
|
7
|
+
data.tar.gz: 3d8309c657c10695635c8087e1f793e585c20f3b1f7f4c0204c4a25701b21a57311c6def387b1c77867e4d049f6ce420977d39af02d0ca42e28dccf3cf8df55c
|
data/.envrc
CHANGED
|
@@ -26,11 +26,15 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __dir__)
|
|
|
26
26
|
|
|
27
27
|
require "robot_lab"
|
|
28
28
|
require "robot_lab/durable"
|
|
29
|
+
require "ruby_llm/providers/lms"
|
|
29
30
|
require "redis"
|
|
30
31
|
require "json"
|
|
31
32
|
|
|
32
33
|
DEBUG_MODE = ARGV.delete("--debug")
|
|
33
|
-
RubyLLM.configure
|
|
34
|
+
RubyLLM.configure do |c|
|
|
35
|
+
c.log_level = DEBUG_MODE ? Logger::DEBUG : Logger::WARN
|
|
36
|
+
c.lms_api_base = ENV.fetch("LMS_API_BASE", "http://localhost:1234/v1")
|
|
37
|
+
end
|
|
34
38
|
|
|
35
39
|
CHANNEL = "stock:xyzzy"
|
|
36
40
|
WINDOW_SIZE = 12 # ticks per prediction window
|
|
@@ -128,12 +132,12 @@ class AdjustParameters < RobotLab::Tool
|
|
|
128
132
|
description "Adjust one predictor parameter to improve future prediction accuracy. " \
|
|
129
133
|
"Make at most one or two targeted changes per window."
|
|
130
134
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
parameter :parameter, type: "string",
|
|
136
|
+
description: "Parameter to adjust: sma_window, sma_std_multiplier, ema_alpha, ema_vol_multiplier, sma_weight"
|
|
137
|
+
parameter :value, type: "number",
|
|
138
|
+
description: "New value (sma_window: 3-30 int; std/vol multipliers: 0.5-4.0; ema_alpha: 0.05-0.5; sma_weight: 0.0-1.0)"
|
|
139
|
+
parameter :reasoning, type: "string",
|
|
140
|
+
description: "Why this change should reduce prediction error"
|
|
137
141
|
|
|
138
142
|
LIMITS = {
|
|
139
143
|
"sma_window" => { min: 3, max: 30, integer: true },
|
|
@@ -226,8 +230,8 @@ redis = Redis.new
|
|
|
226
230
|
prices = []
|
|
227
231
|
robot = RobotLab.build(
|
|
228
232
|
name: "predictor_tuner",
|
|
229
|
-
model: "
|
|
230
|
-
provider: :
|
|
233
|
+
model: ENV.fetch("LMS_MODEL", "qwen/qwen3.8-27b"),
|
|
234
|
+
provider: :lms,
|
|
231
235
|
system_prompt: <<~PROMPT,
|
|
232
236
|
You are a quantitative analyst tuning an ensemble stock price range
|
|
233
237
|
predictor for ticker XYZZY. Each prediction covers the high and low
|
|
@@ -7,7 +7,7 @@ module RobotLab
|
|
|
7
7
|
'to check if you have seen a similar situation before. ' \
|
|
8
8
|
'When in doubt and no relevant knowledge is found, skip the action.'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
parameter :query, type: 'string', description: 'Natural language description of the decision you are about to make'
|
|
11
11
|
|
|
12
12
|
def execute(query:)
|
|
13
13
|
adapter = RobotLab::Durable::Hook.current_adapter
|
|
@@ -7,10 +7,10 @@ module RobotLab
|
|
|
7
7
|
'a user preference, a reliable pattern, or a factual insight. ' \
|
|
8
8
|
'Recorded knowledge persists across future sessions.'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
parameter :content, type: 'string', description: 'The knowledge to record, in plain language (one clear statement)'
|
|
11
|
+
parameter :reasoning, type: 'string',
|
|
12
|
+
description: 'Why this is worth remembering — the observation or discussion that led to it'
|
|
13
|
+
parameter :category, type: 'string', description: 'One of: fact, preference, pattern, correction'
|
|
14
14
|
|
|
15
15
|
def execute(content:, reasoning:, category:)
|
|
16
16
|
adapter = RobotLab::Durable::Hook.current_adapter
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: robot_lab-durable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dewayne VanHoozer
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.3.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.3.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: htm
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
requirements: []
|
|
98
|
-
rubygems_version: 4.0.
|
|
98
|
+
rubygems_version: 4.0.21
|
|
99
99
|
specification_version: 4
|
|
100
100
|
summary: HTM-backed long-term memory for RobotLab agents
|
|
101
101
|
test_files: []
|