Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Add SubQ as a memory evaluator provider

Claude2c7c7571d418
diff --git a/agent-skills/skills/beacon-memory-distill/SKILL.md b/agent-skills/skills/beacon-memory-distill/SKILL.md
index 004447d9..4c28ca64 100644
--- a/agent-skills/skills/beacon-memory-distill/SKILL.md
+++ b/agent-skills/skills/beacon-memory-distill/SKILL.md
@@ -2,7 +2,7 @@
name: beacon-memory-distill
description: Turn recorded agent sessions (Beacon traces from Claude Code, Cursor, Codex, OpenCode, and other harnesses) into reviewed, reusable project memory. Scores selected traces, reads the source trace behind each high-signal candidate, drafts a grounded lesson, and approves it only after the user confirms. Use when the user asks to "learn from", "remember", "save the lesson from", or "turn into memory" a recent session, fix, or debugging effort, or asks to review Beacon memory candidates.
license: MIT
-compatibility: Requires the Beacon CLI (beacon) on PATH with endpoint capture installed. Scoring calls the configured Jev evaluator over the network (hosted TypeSafe by default) and needs TYPESAFE_API_KEY or BEACON_JEV_API_KEY; every other step is local.
+compatibility: Requires the Beacon CLI (beacon) on PATH with endpoint capture installed. Scoring calls the configured evaluator over the network (hosted TypeSafe Jev by default, or SubQ with --evaluator subq) and needs TYPESAFE_API_KEY or BEACON_JEV_API_KEY for Jev, or SUBQ_API_KEY or BEACON_SUBQ_API_KEY for SubQ; every other step is local.
metadata:
author: asymptote-labs
homepage: https://docs.beacon.sh/concepts/cross-harness-memory
@@ -87,19 +87,24 @@ beacon memory evaluations run --dry-run --limit 10 --harness <name> --since <rfc
Before the real run, tell the user plainly and **wait for an explicit yes**:
- Each selected trace is sent, as a bounded and redacted projection, to the evaluator at
- `BEACON_JEV_ENDPOINT` if that is set, otherwise to the hosted TypeSafe endpoint.
+ `BEACON_JEV_ENDPOINT` if that is set, otherwise to the hosted TypeSafe endpoint. With
+ `--evaluator subq` (or `BEACON_EVALUATOR=subq`) it goes to `BEACON_SUBQ_ENDPOINT`,
+ otherwise the hosted SubQ endpoint; name whichever applies.
- It costs about the estimate the dry run printed.
- Nothing is approved or written into memory by this step.
Check for a key without printing it:
```bash
-test -n "${TYPESAFE_API_KEY:-}${BEACON_JEV_API_KEY:-}" && echo "evaluator key present" || echo "no evaluator key"
+test -n "${TYPESAFE_API_KEY:-}${BEACON_JEV_API_KEY:-}" && echo "Jev key present" || echo "no Jev key"
+test -n "${SUBQ_API_KEY:-}${BEACON_SUBQ_API_KEY:-}" && echo "SubQ key present" || echo "no SubQ key"
```
-With no key, stop and tell the user to export `TYPESAFE_API_KEY` (or point
+If only a SubQ key is present, add `--evaluator subq` to the dry run and the real run.
+
+With no key, stop and tell the user to export `TYPESAFE_API_KEY` or `SUBQ_API_KEY` (or point
`BEACON_JEV_ENDPOINT` at their organization's compatible evaluator). Never ask them to
-paste a key into the chat, and never pass `--jev-api-key` on the command line. If the user
+paste a key into the chat, and never pass `--jev-api-key` or `--subq-api-key` on the command line. If the user
or their organization does not allow external evaluation, or has no key and does not want
one, skip Steps 3 and 4 and go to [Without an evaluator](#without-an-evaluator).
diff --git a/cli/beacon/cmd/memory.go b/cli/beacon/cmd/memory.go
index e280061c..c3da58c7 100644
--- a/cli/beacon/cmd/memory.go
+++ b/cli/beacon/cmd/memory.go
@@ -18,34 +18,38 @@ import (
)
var memoryOpts struct {
- userMode bool
- systemMode bool
- logPath string
- jsonOutput bool
- projectPath string
- limit int
- page int
- query string
- harness string
- traceID string
- since string
- until string
- dryRun bool
- jevEndpoint string
- jevAPIKey string
- jevModel string
- jevCost float64
- timeout time.Duration
- state string
- kind string
- reason string
- replacement string
- force bool
- title string
- body string
- bodyFile string
- applies string
- tags []string
+ userMode bool
+ systemMode bool
+ logPath string
+ jsonOutput bool
+ projectPath string
+ limit int
+ page int
+ query string
+ harness string
+ traceID string
+ since string
+ until string
+ dryRun bool
+ evaluator string
+ jevEndpoint string
+ jevAPIKey string
+ jevModel string
+ jevCost float64
+ subqEndpoint string
+ subqAPIKey string
+ subqModel string
+ timeout time.Duration
+ state string
+ kind string
+ reason string
+ replacement string
+ force bool
+ title string
+ body string
+ bodyFile string
+ applies string
+ tags []string
}
var memoryCmd = &cobra.Command{
@@ -75,7 +79,7 @@ var memoryEvaluationsCmd = &cobra.Command{
var memoryEvaluationsRunCmd = &cobra.Command{
Use: "run",
- Short: "Evaluate local traces with Jev",
+ Short: "Evaluate local traces with Jev or SubQ",
SilenceUsage: true,
RunE: runMemoryEvaluationsRun,
}
@@ -245,12 +249,16 @@ func init() {
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.traceID, "trace", "", "Evaluate a single trace ID")
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.since, "since", "", "RFC3339 lower time bound, inclusive")
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.until, "until", "", "RFC3339 upper time bound, inclusive")
- memoryEvaluationsRunCmd.Flags().BoolVar(&memoryOpts.dryRun, "dry-run", false, "Preview selected traces, Jev calls, and estimated cost without writing evaluations")
+ memoryEvaluationsRunCmd.Flags().BoolVar(&memoryOpts.dryRun, "dry-run", false, "Preview selected traces, evaluator calls, and estimated cost without writing evaluations")
+ memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.evaluator, "evaluator", "", "Evaluator provider: jev or subq (defaults to BEACON_EVALUATOR, then jev)")
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.jevEndpoint, "jev-endpoint", "", "Jev System One endpoint (defaults to BEACON_JEV_ENDPOINT, then "+learning.DefaultJevEndpoint+")")
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.jevAPIKey, "jev-api-key", "", "Jev API key (defaults to TYPESAFE_API_KEY, then BEACON_JEV_API_KEY)")
memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.jevModel, "jev-model", "", "Jev model name, such as jev-latest or a pinned Jev version (defaults to BEACON_JEV_MODEL, then "+learning.DefaultJevModel+")")
- memoryEvaluationsRunCmd.Flags().Float64Var(&memoryOpts.jevCost, "jev-cost-per-trace", learning.DefaultCostPerTrace, "Estimated Jev cost per trace in USD")
- memoryEvaluationsRunCmd.Flags().DurationVar(&memoryOpts.timeout, "timeout", 10*time.Second, "Jev request timeout")
+ memoryEvaluationsRunCmd.Flags().Float64Var(&memoryOpts.jevCost, "jev-cost-per-trace", learning.DefaultCostPerTrace, "Estimated evaluator cost per trace in USD, for Jev or SubQ")
+ memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.subqEndpoint, "subq-endpoint", "", "SubQ Decisions API endpoint (defaults to BEACON_SUBQ_ENDPOINT, then "+learning.DefaultSubQEndpoint+")")
+ memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.subqAPIKey, "subq-api-key", "", "SubQ API key (defaults to SUBQ_API_KEY, then BEACON_SUBQ_API_KEY)")
+ memoryEvaluationsRunCmd.Flags().StringVar(&memoryOpts.subqModel, "subq-model", "", "SubQ System One model name (defaults to BEACON_SUBQ_MODEL, then "+learning.DefaultSubQModel+")")
+ memoryEvaluationsRunCmd.Flags().DurationVar(&memoryOpts.timeout, "timeout", 10*time.Second, "Evaluator request timeout")
}
func runMemoryList(cmd *cobra.Command, args []string) error {
@@ -311,7 +319,10 @@ func runMemoryEvaluationsRun(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
- evaluatorOpts := jevEvaluatorOptions()
+ evaluatorOpts, err := evaluatorOptions()
+ if err != nil {
+ return err
+ }
result := evaluationRunResult{
DryRun: memoryOpts.dryRun,
StorePath: store.Path(),
@@ -355,7 +366,7 @@ func runMemoryEvaluationsRun(cmd *cobra.Command, args []string) error {
return json.NewEncoder(cmd.OutOrStdout()).Encode(result)
}
if result.DryRun {
- fmt.Fprintf(cmd.OutOrStdout(), "Selected %d trace(s); estimated Jev calls: %d; estimated cost: $%.5f\n", result.TraceCount, result.EstimatedCalls, result.EstimatedCostUSD)
+ fmt.Fprintf(cmd.OutOrStdout(), "Selected %d trace(s); estimated %s calls: %d; estimated cost: $%.5f\n", result.TraceCount, evaluatorDisplayName(evaluatorOpts.Provider), result.EstimatedCalls, result.EstimatedCostUSD)
for _, preview := range result.Previews {
fmt.Fprintf(cmd.OutOrStdout(), "%s\t%s\t%s\t$%.5f\n", preview.TraceID, preview.Title, firstNonEmpty(preview.Project.Path, preview.Project.ID), preview.EstimatedCostUSD)
}
@@ -700,11 +711,46 @@ func parseMemoryTime(name, value string) (time.Time, error) {
return parsed, nil
}
+// evaluatorOptions picks the provider from --evaluator, then BEACON_EVALUATOR,
+// then Jev, and resolves that provider's settings.
+func evaluatorOptions() (learning.EvaluatorOptions, error) {
+ provider := learning.NormalizeProvider(firstNonEmpty(memoryOpts.evaluator, os.Getenv("BEACON_EVALUATOR")))
+ switch provider {
+ case learning.ProviderJev:
+ return jevEvaluatorOptions(), nil
+ case learning.ProviderSubQ:
+ return subqEvaluatorOptions(), nil
+ }
+ _, _, err := learning.ProviderDefaults(provider)
+ return learning.EvaluatorOptions{}, err
+}
+
+func evaluatorDisplayName(provider string) string {
+ if learning.NormalizeProvider(provider) == learning.ProviderSubQ {
+ return "SubQ"
+ }
+ return "Jev"
+}
+
+// subqEvaluatorOptions resolves each SubQ setting from its flag, then the
+// environment, then the built-in default, the same way as the Jev settings.
+func subqEvaluatorOptions() learning.EvaluatorOptions {
+ return learning.EvaluatorOptions{
+ Provider: learning.ProviderSubQ,
+ Endpoint: firstNonEmpty(memoryOpts.subqEndpoint, os.Getenv("BEACON_SUBQ_ENDPOINT"), learning.DefaultSubQEndpoint),
+ APIKey: firstNonEmpty(memoryOpts.subqAPIKey, os.Getenv("SUBQ_API_KEY"), os.Getenv("BEACON_SUBQ_API_KEY")),
+ Model: firstNonEmpty(memoryOpts.subqModel, os.Getenv("BEACON_SUBQ_MODEL"), learning.DefaultSubQModel),
+ CostPerTrace: memoryOpts.jevCost,
+ Timeout: memoryOpts.timeout,
+ }
+}
+
// jevEvaluatorOptions resolves each Jev setting from its flag, then the environment,
// then the built-in default. The flags must not carry the defaults themselves, or the
// environment variables documented for them would never be consulted.
func jevEvaluatorOptions() learning.EvaluatorOptions {
return learning.EvaluatorOptions{
+ Provider: learning.ProviderJev,
Endpoint: firstNonEmpty(memoryOpts.jevEndpoint, os.Getenv("BEACON_JEV_ENDPOINT"), learning.DefaultJevEndpoint),
APIKey: firstNonEmpty(memoryOpts.jevAPIKey, os.Getenv("TYPESAFE_API_KEY"), os.Getenv("BEACON_JEV_API_KEY")),
Model: firstNonEmpty(memoryOpts.jevModel, os.Getenv("BEACON_JEV_MODEL"), learning.DefaultJevModel),
diff --git a/cli/beacon/cmd/memory_test.go b/cli/beacon/cmd/memory_test.go
index 2ea6499a..1e4def80 100644
--- a/cli/beacon/cmd/memory_test.go
+++ b/cli/beacon/cmd/memory_test.go
@@ -546,34 +546,38 @@ func resetMemoryOpts(t *testing.T) {
t.Helper()
previous := memoryOpts
memoryOpts = struct {
- userMode bool
- systemMode bool
- logPath string
- jsonOutput bool
- projectPath string
- limit int
- page int
- query string
- harness string
- traceID string
- since string
- until string
- dryRun bool
- jevEndpoint string
- jevAPIKey string
- jevModel string
- jevCost float64
- timeout time.Duration
- state string
- kind string
- reason string
- replacement string
- force bool
- title string
- body string
- bodyFile string
- applies string
- tags []string
+ userMode bool
+ systemMode bool
+ logPath string
+ jsonOutput bool
+ projectPath string
+ limit int
+ page int
+ query string
+ harness string
+ traceID string
+ since string
+ until string
+ dryRun bool
+ evaluator string
+ jevEndpoint string
+ jevAPIKey string
+ jevModel string
+ jevCost float64
+ subqEndpoint string
+ subqAPIKey string
+ subqModel string
+ timeout time.Duration
+ state string
+ kind string
+ reason string
+ replacement string
+ force bool
+ title string
+ body string
+ bodyFile string
+ applies string
+ tags []string
}{userMode: true, limit: 25, page: 1, jevCost: learning.DefaultCostPerTrace}
t.Cleanup(func() { memoryOpts = previous })
}
@@ -786,3 +790,108 @@ func TestJevEvaluatorOptionsPrecedence(t *testing.T) {
})
}
}
+
+// SubQ's Decisions API is the same System One contract as Jev, so selecting it
+// must send the same request to the SubQ endpoint with SUBQ_API_KEY and record
+// the evaluation under the subq provider.
+func TestMemoryEvaluationsRunWithSubQ(t *testing.T) {
+ logPath, project := writeMemoryCommandFixture(t)
+ var gotModel string
+ var gotTypes []string
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.Header.Get("Authorization") != "Bearer subq-key" {
+ t.Errorf("Authorization = %q, want Bearer subq-key", r.Header.Get("Authorization"))
+ }
+ var req struct {
+ Model string `json:"model"`
+ Questions map[string]struct{ Type string } `json:"questions"`
+ }
+ if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
+ t.Errorf("decode request: %v", err)
+ }
+ gotModel = req.Model
+ for _, q := range req.Questions {
+ gotTypes = append(gotTypes, q.Type)
+ }
+ _, _ = w.Write([]byte(`{"model":"subq-snap-preview","answers":{"task_success":{"type":"noul","noul":0.9},"reusable_correction":{"type":"noul","noul":0.8},"evidence_supported":{"type":"noul","noul":0.7}},"usage":{"input_tokens":120,"output_tokens":0}}`))
+ }))
+ defer server.Close()
+
+ t.Setenv("BEACON_EVALUATOR", "subq")
+ t.Setenv("BEACON_SUBQ_ENDPOINT", server.URL)
+ t.Setenv("BEACON_SUBQ_MODEL", "")
+ t.Setenv("SUBQ_API_KEY", "subq-key")
+ t.Setenv("TYPESAFE_API_KEY", "jev-key-must-not-be-sent")
+
+ resetMemoryOpts(t)
+ memoryOpts.userMode = true
+ memoryOpts.logPath = logPath
+ memoryOpts.projectPath = project
+ memoryOpts.traceID = "session:cursor:s1"
+ memoryOpts.jsonOutput = true
+
+ var out bytes.Buffer
+ cmd := &cobra.Command{}
+ cmd.SetOut(&out)
+ if err := runMemoryEvaluationsRun(cmd, nil); err != nil {
+ t.Fatalf("runMemoryEvaluationsRun returned error: %v", err)
+ }
+ if gotModel != learning.DefaultSubQModel {
+ t.Fatalf("request model = %q, want %s", gotModel, learning.DefaultSubQModel)
+ }
+ if len(gotTypes) != len(learning.RubricQuestions) {
+ t.Fatalf("question types = %v", gotTypes)
+ }
+ for _, typ := range gotTypes {
+ if typ != "noul" {
+ t.Fatalf("question type = %q, want noul", typ)
+ }
+ }
+ var result evaluationRunResult
+ if err := json.Unmarshal(out.Bytes(), &result); err != nil {
+ t.Fatalf("decode result: %v\n%s", err, out.String())
+ }
+ if len(result.Evaluations) != 1 {
+ t.Fatalf("evaluations = %#v", result.Evaluations)
+ }
+ if got, want := result.Evaluations[0].Evaluator, "subq:"+server.URL; got != want {
+ t.Fatalf("evaluator = %q, want %q", got, want)
+ }
+}
+
+func TestEvaluatorOptionsSelectsProvider(t *testing.T) {
+ for k, v := range map[string]string{
+ "BEACON_EVALUATOR": "", "BEACON_SUBQ_ENDPOINT": "", "BEACON_SUBQ_MODEL": "", "SUBQ_API_KEY": "", "BEACON_SUBQ_API_KEY": "fallback-subq",
+ "BEACON_JEV_ENDPOINT": "", "BEACON_JEV_MODEL": "", "TYPESAFE_API_KEY": "", "BEACON_JEV_API_KEY": "",
+ } {
+ t.Setenv(k, v)
+ }
+ resetMemoryOpts(t)
+ got, err := evaluatorOptions()
+ if err != nil || got.Provider != learning.ProviderJev || got.Endpoint != learning.DefaultJevEndpoint {
+ t.Fatalf("default evaluatorOptions() = %+v, %v; want Jev defaults", got, err)
+ }
+
+ memoryOpts.evaluator = "SubQ"
+ got, err = evaluatorOptions()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got.Provider != learning.ProviderSubQ || got.Endpoint != learning.DefaultSubQEndpoint || got.Model != learning.DefaultSubQModel || got.APIKey != "fallback-subq" {
+ t.Fatalf("subq evaluatorOptions() = %+v", got)
+ }
+
+ memoryOpts.subqEndpoint = "https://flag.example/v1/systemone"
+ memoryOpts.subqModel = "subq-pinned"
+ memoryOpts.subqAPIKey = "flag-key"
+ t.Setenv("SUBQ_API_KEY", "env-key")
+ got, _ = evaluatorOptions()
+ if got.Endpoint != "https://flag.example/v1/systemone" || got.Model != "subq-pinned" || got.APIKey != "flag-key" {
+ t.Fatalf("subq flags did not win: %+v", got)
+ }
+
+ memoryOpts.evaluator = "openai"
+ if _, err := evaluatorOptions(); err == nil {
+ t.Fatal("unknown evaluator was accepted")
+ }
+}
diff --git a/cli/beacon/internal/agentskills/skills/beacon-memory-distill/SKILL.md b/cli/beacon/internal/agentskills/skills/beacon-memory-distill/SKILL.md
index 004447d9..4c28ca64 100644
--- a/cli/beacon/internal/agentskills/skills/beacon-memory-distill/SKILL.md
+++ b/cli/beacon/internal/agentskills/skills/beacon-memory-distill/SKILL.md
@@ -2,7 +2,7 @@
name: beacon-memory-distill
description: Turn recorded agent sessions (Beacon traces from Claude Code, Cursor, Codex, OpenCode, and other harnesses) into reviewed, reusable project memory. Scores selected traces, reads the source trace behind each high-signal candidate, drafts a grounded lesson, and approves it only after the user confirms. Use when the user asks to "learn from", "remember", "save the lesson from", or "turn into memory" a recent session, fix, or debugging effort, or asks to review Beacon memory candidates.
license: MIT
-compatibility: Requires the Beacon CLI (beacon) on PATH with endpoint capture installed. Scoring calls the configured Jev evaluator over the network (hosted TypeSafe by default) and needs TYPESAFE_API_KEY or BEACON_JEV_API_KEY; every other step is local.
+compatibility: Requires the Beacon CLI (beacon) on PATH with endpoint capture installed. Scoring calls the configured evaluator over the network (hosted TypeSafe Jev by default, or SubQ with --evaluator subq) and needs TYPESAFE_API_KEY or BEACON_JEV_API_KEY for Jev, or SUBQ_API_KEY or BEACON_SUBQ_API_KEY for SubQ; every other step is local.
metadata:
author: asymptote-labs
homepage: https://docs.beacon.sh/concepts/cross-harness-memory
@@ -87,19 +87,24 @@ beacon memory evaluations run --dry-run --limit 10 --harness <name> --since <rfc
Before the real run, tell the user plainly and **wait for an explicit yes**:
- Each selected trace is sent, as a bounded and redacted projection, to the evaluator at
- `BEACON_JEV_ENDPOINT` if that is set, otherwise to the hosted TypeSafe endpoint.
+ `BEACON_JEV_ENDPOINT` if that is set, otherwise to the hosted TypeSafe endpoint. With
+ `--evaluator subq` (or `BEACON_EVALUATOR=subq`) it goes to `BEACON_SUBQ_ENDPOINT`,
+ otherwise the hosted SubQ endpoint; name whichever applies.
- It costs about the estimate the dry run printed.
- Nothing is approved or written into memory by this step.
Check for a key without printing it:
```bash
-test -n "${TYPESAFE_API_KEY:-}${BEACON_JEV_API_KEY:-}" && echo "evaluator key present" || echo "no evaluator key"
+test -n "${TYPESAFE_API_KEY:-}${BEACON_JEV_API_KEY:-}" && echo "Jev key present" || echo "no Jev key"
+test -n "${SUBQ_API_KEY:-}${BEACON_SUBQ_API_KEY:-}" && echo "SubQ key present" || echo "no SubQ key"
```
-With no key, stop and tell the user to export `TYPESAFE_API_KEY` (or point
+If only a SubQ key is present, add `--evaluator subq` to the dry run and the real run.
+
+With no key, stop and tell the user to export `TYPESAFE_API_KEY` or `SUBQ_API_KEY` (or point
`BEACON_JEV_ENDPOINT` at their organization's compatible evaluator). Never ask them to
-paste a key into the chat, and never pass `--jev-api-key` on the command line. If the user
+paste a key into the chat, and never pass `--jev-api-key` or `--subq-api-key` on the command line. If the user
or their organization does not allow external evaluation, or has no key and does not want
one, skip Steps 3 and 4 and go to [Without an evaluator](#without-an-evaluator).
diff --git a/cli/beacon/internal/learning/evaluator.go b/cli/beacon/internal/learning/evaluator.go
index 94a89d5c..152d106d 100644
--- a/cli/beacon/internal/learning/evaluator.go
+++ b/cli/beacon/internal/learning/evaluator.go
@@ -19,15 +19,56 @@ const (
RubricVersion = "beacon.learning.rubric.v1"
DefaultJevEndpoint = "https://api.typesafe.ai/v1/systemone"
DefaultJevModel = "jev-latest"
+ DefaultSubQEndpoint = "https://api.subq.ai/v1/systemone"
+ DefaultSubQModel = "subq-snap-preview"
DefaultCostPerTrace = 0.00035
maxProjectionEvents = 80
maxProjectionText = 1200
- // jevQuestionType is the System One question type Beacon asks for. Jev echoes
- // it back as each answer's "type", which is not a rationale.
+ // jevQuestionType is the System One question type Beacon asks for. Jev and
+ // SubQ echo it back as each answer's "type", which is not a rationale.
jevQuestionType = "noul"
)
+// Evaluator providers. Both speak the System One decisions API (a POST of
+// model, state and typed questions answered with probabilities), so they share
+// one request and response shape and differ only in their hosted defaults.
+const (
+ ProviderJev = "jev"
+ ProviderSubQ = "subq"
+)
+
+// Providers lists the accepted --evaluator values.
+var Providers = []string{ProviderJev, ProviderSubQ}
+
+// ProviderDefaults returns the hosted endpoint and model for a provider.
+func ProviderDefaults(provider string) (endpoint, model string, err error) {
+ switch NormalizeProvider(provider) {
+ case ProviderJev:
+ return DefaultJevEndpoint, DefaultJevModel, nil
+ case ProviderSubQ:
+ return DefaultSubQEndpoint, DefaultSubQModel, nil
+ }
+ return "", "", fmt.Errorf("unknown evaluator %q (want one of %s)", provider, strings.Join(Providers, ", "))
+}
+
+// NormalizeProvider lowercases a provider name; empty means Jev, the original
+// and default evaluator.
+func NormalizeProvider(provider string) string {
+ provider = strings.ToLower(strings.TrimSpace(provider))
+ if provider == "" {
+ return ProviderJev
+ }
+ return provider
+}
+
+func providerLabel(opts EvaluatorOptions) string {
+ if NormalizeProvider(opts.Provider) == ProviderSubQ {
+ return "SubQ"
+ }
+ return "Jev"
+}
+
var RubricQuestions = []asymptoteobserve.LearningEvaluationQuestionV1{
{ID: TaskSuccessQuestionID, Prompt: "Did the trace complete the user's engineering task successfully?"},
{ID: "reusable_correction", Prompt: "Does the trace contain a correction or debugging pattern that future agents should reuse?"},
@@ -35,6 +76,8 @@ var RubricQuestions = []asymptoteobserve.LearningEvaluationQuestionV1{
}
type EvaluatorOptions struct {
+ // Provider is ProviderJev (the default when empty) or ProviderSubQ.
+ Provider string
Endpoint string
APIKey string
Model string
@@ -125,7 +168,7 @@ func Evaluate(ctx context.Context, opts EvaluatorOptions, input EvaluationInput)
return evaluation, nil
}
if strings.TrimSpace(opts.Endpoint) == "" {
- opts.Endpoint = DefaultJevEndpoint
+ opts.Endpoint = defaultEndpoint(opts)
}
resp, err := callEvaluator(ctx, opts, projection)
if err != nil {
@@ -142,7 +185,7 @@ func Evaluate(ctx context.Context, opts EvaluatorOptions, input EvaluationInput)
questions = resp.Results
}
if len(questions) == 0 {
- return asymptoteobserve.LearningEvaluationV1{}, fmt.Errorf("Jev response did not include answers, questions, or results")
+ return asymptoteobserve.LearningEvaluationV1{}, fmt.Errorf("%s response did not include answers, questions, or results", providerLabel(opts))
}
evaluation.Questions = normalizeQuestionResults(questions)
evaluation.Score = evaluationScore(evaluation.Questions)
@@ -176,7 +219,7 @@ func Preview(input EvaluationInput, opts EvaluatorOptions) EvaluationPreview {
EventCount: input.Trace.Range.TotalEvents,
EstimatedCalls: 1,
EstimatedCostUSD: costPerTrace(opts),
- Reason: "explicit evaluation command; hooks and collectors do not call Jev",
+ Reason: "explicit evaluation command; hooks and collectors do not call " + providerLabel(opts),
Project: input.Project,
}
}
@@ -305,7 +348,7 @@ func callEvaluator(ctx context.Context, opts EvaluatorOptions, projection Projec
return jevResponse{}, err
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
- return jevResponse{}, fmt.Errorf("Jev endpoint returned %s: %s", resp.Status, strings.TrimSpace(string(data)))
+ return jevResponse{}, fmt.Errorf("%s endpoint returned %s: %s", providerLabel(opts), resp.Status, strings.TrimSpace(string(data)))
}
var parsed jevResponse
if err := json.Unmarshal(data, &parsed); err != nil {
@@ -418,17 +461,32 @@ func evaluationScore(results []asymptoteobserve.LearningEvaluationQuestionV1) fl
}
func evaluatorName(opts EvaluatorOptions) string {
+ provider := NormalizeProvider(opts.Provider)
if opts.Endpoint == "" {
- return "jev:" + DefaultJevEndpoint
+ return provider + ":" + defaultEndpoint(opts)
+ }
+ return provider + ":" + opts.Endpoint
+}
+
+func defaultEndpoint(opts EvaluatorOptions) string {
+ endpoint, _ := providerDefaultsOrJev(opts.Provider)
+ return endpoint
+}
+
+func providerDefaultsOrJev(provider string) (endpoint, model string) {
+ endpoint, model, err := ProviderDefaults(provider)
+ if err != nil {
+ return DefaultJevEndpoint, DefaultJevModel
}
- return "jev:" + opts.Endpoint
+ return endpoint, model
}
func modelName(opts EvaluatorOptions) string {
if strings.TrimSpace(opts.Model) != "" {
return strings.TrimSpace(opts.Model)
}
- return DefaultJevModel
+ _, model := providerDefaultsOrJev(opts.Provider)
+ return model
}
func costPerTrace(opts EvaluatorOptions) float64 {
diff --git a/docs/cli/memory.mdx b/docs/cli/memory.mdx
index a8093906..6e92860f 100644
--- a/docs/cli/memory.mdx
+++ b/docs/cli/memory.mdx
@@ -45,7 +45,7 @@ it came from; pass `--project` for that too.
## Evaluate traces
-Preview selected traces and estimated Jev calls without a network request:
+Preview selected traces and estimated evaluator calls without a network request:
```bash
beacon memory evaluations run --dry-run --limit 10
@@ -66,11 +66,15 @@ Useful flags:
- `--since <rfc3339>` and `--until <rfc3339>` bound the trace window.
- `--limit <n>` and `--page <n>` page through selected traces.
- `--query <text>` or `-q <text>` searches trace text before evaluation.
+- `--evaluator <jev|subq>` selects the evaluator provider. It defaults to
+ `BEACON_EVALUATOR`, then `jev`.
- `--jev-model <model>` selects the Jev model, such as `jev-latest` or a pinned version.
- `--jev-endpoint <url>` overrides the TypeSafe System One endpoint.
- `--jev-api-key <key>` overrides API key lookup.
-- `--jev-cost-per-trace <usd>` changes the dry-run cost estimate.
-- `--timeout <duration>` sets the Jev request timeout.
+- `--subq-model <model>`, `--subq-endpoint <url>` and `--subq-api-key <key>` are the
+ same settings for SubQ.
+- `--jev-cost-per-trace <usd>` changes the dry-run cost estimate, for either evaluator.
+- `--timeout <duration>` sets the evaluator request timeout.
- `--json` prints machine-readable output.
Each Jev setting is resolved from the flag first, then the environment, then the
@@ -91,6 +95,28 @@ export BEACON_JEV_MODEL=typesafe-ai/jev
beacon memory evaluations run --limit 10
```
+### SubQ
+
+[SubQ's Decisions API](https://docs.subq.ai/endpoints/decisions-api/) is the same
+System One contract (`model`, `state` and typed `noul` questions, answered with
+probabilities), so Beacon sends it the identical request. Select it with
+`--evaluator subq` or `BEACON_EVALUATOR=subq`:
+
+```bash
+export SUBQ_API_KEY=...
+beacon memory evaluations run --evaluator subq --trace session:cursor:s1
+```
+
+Each SubQ setting resolves the same way as the Jev ones:
+
+- `--subq-api-key` defaults to `SUBQ_API_KEY`, then `BEACON_SUBQ_API_KEY`.
+- `--subq-endpoint` defaults to `BEACON_SUBQ_ENDPOINT`, then
+ `https://api.subq.ai/v1/systemone`.
+- `--subq-model` defaults to `BEACON_SUBQ_MODEL`, then `subq-snap-preview`.
+
+SubQ bills input tokens only; the token counts it reports are stored with the
+evaluation. Evaluations record their provider and endpoint as `subq:<endpoint>`.
+
Each completed evaluation stores a `score`, the plain mean of the three rubric
probabilities. A trace becomes a review candidate only when both hold:
diff --git a/docs/concepts/cross-harness-memory.mdx b/docs/concepts/cross-harness-memory.mdx
index 939b5a8d..7f0f590b 100644
--- a/docs/concepts/cross-harness-memory.mdx
+++ b/docs/concepts/cross-harness-memory.mdx
@@ -29,7 +29,7 @@ The loop is:
candidate as you do.
5. Reuse approved memory through Beacon MCP or install it as an Agent Skill.
-This is deliberately review-gated. Jev probabilities help rank and classify traces;
+This is deliberately review-gated. Evaluator probabilities help rank and classify traces;
they do not automatically rewrite instructions, install skills, or execute actions.
## Jev evaluation
@@ -63,6 +63,12 @@ The evaluator uses the hosted TypeSafe endpoint and `jev-latest` by default. Set
`--jev-endpoint` / `BEACON_JEV_ENDPOINT` and `--jev-model` / `BEACON_JEV_MODEL`
to target an internal compatible evaluator.
+SubQ's [Decisions API](https://docs.subq.ai/endpoints/decisions-api/) speaks the same
+System One contract, so `--evaluator subq` (or `BEACON_EVALUATOR=subq`) sends the same
+projection and questions to `https://api.subq.ai/v1/systemone` with `subq-snap-preview`,
+using `SUBQ_API_KEY` or `BEACON_SUBQ_API_KEY`. See
+[`beacon memory`](/cli/memory#subq) for its flags.
+
## Local storage and scope
Learning artifacts are stored in `memory.db` next to the endpoint runtime log base
@@ -125,9 +131,9 @@ install and publishing matrix.
## Privacy boundary
-- Hooks never call Jev.
-- Dry runs do not call Jev.
-- Jev calls are made only by the explicit `beacon memory evaluations run` command.
+- Hooks never call Jev or SubQ.
+- Dry runs do not call an evaluator.
+- Evaluator calls are made only by the explicit `beacon memory evaluations run` command.
- Trace projections are bounded and redacted before being sent.
- Candidate approval and skill installation are explicit CLI actions.
- The dashboard's Memory page is read-only; review transitions and skill writes stay
diff --git a/docs/security/data-inventory.mdx b/docs/security/data-inventory.mdx
index cb48abf9..0d4498cc 100644
--- a/docs/security/data-inventory.mdx
+++ b/docs/security/data-inventory.mdx
@@ -73,7 +73,7 @@ learning artifacts scoped to the resolved project:
| Memory area | Data retained |
|-------------|---------------|
-| Evaluations | Trace identity, project identity, bounded trace summary, Jev question results, evaluator model, usage metadata when returned, and evaluation timestamps |
+| Evaluations | Trace identity, project identity, bounded trace summary, Jev or SubQ question results, evaluator model, usage metadata when returned, and evaluation timestamps |
| Candidates | Candidate title, body, kind, state, evidence pointers, source evaluation, project identity, and review transition metadata |
| Approved memories | Approved title, body, kind, project identity, provenance, and review metadata |
@@ -84,10 +84,11 @@ to `.agents/skills/<slug>/SKILL.md`; Beacon hooks and the dashboard never instal
skills or mutate memory review state.
`beacon memory evaluations run` is the only command in this workflow that can call
-Jev. Dry runs do not make a network request. When evaluation is enabled, Beacon
-sends a bounded, redacted trace projection to the configured TypeSafe System One
-endpoint or a compatible internal endpoint. Normal endpoint capture, MCP reads,
-dashboard views, candidate review, and skill preview/install do not call Jev.
+an evaluator. Dry runs do not make a network request. When evaluation is enabled, Beacon
+sends a bounded, redacted trace projection to the configured System One endpoint:
+TypeSafe Jev by default, SubQ with `--evaluator subq`, or a compatible internal
+endpoint. Normal endpoint capture, MCP reads, dashboard views, candidate review, and
+skill preview/install do not call an evaluator.
## Required fields