@mastra/oracledb 0.5.1-alpha.0 → 0.5.1

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.
@@ -3,7 +3,7 @@ name: mastra-oracledb
3
3
  description: Documentation for @mastra/oracledb. Use when working with @mastra/oracledb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/oracledb"
6
- version: "0.5.1-alpha.0"
6
+ version: "0.5.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.1-alpha.0",
2
+ "version": "0.5.1",
3
3
  "package": "@mastra/oracledb",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -76,7 +76,7 @@ console.log(secondResponse.text)
76
76
 
77
77
  The `resource` identifies the user or entity, while the `thread` identifies the conversation. Reuse both values to continue the same conversation. Observational Memory processes the stored history as it grows and replaces older messages with observations when its activation conditions are met.
78
78
 
79
- The agent now has humanlike long-term memory that persists across conversations. Setting `observationalMemory: true` uses `google/gemini-2.5-flash` by default. To use a different model, pass it in the config object:
79
+ The agent now has humanlike long-term memory that persists across conversations. Setting `observationalMemory: true` uses automatic model selection. To use a specific model, pass it in the config object:
80
80
 
81
81
  ```typescript
82
82
  const memory = new Memory({
@@ -98,7 +98,17 @@ See [configuration options](https://mastra.ai/reference/memory/observational-mem
98
98
  >
99
99
  > For an AI SDK example, see [Using Mastra Memory](https://mastra.ai/integrations/agentic-ui/ai-sdk-ui).
100
100
 
101
- > **Note:** OM currently only supports `@mastra/pg`, `@mastra/libsql`, `@mastra/mysql`, `@mastra/mongodb`, `@mastra/convex`, and `@mastra/oracledb` storage adapters. It uses background agents for managing memory. When no model is set, the default model is `google/gemini-2.5-flash`.
101
+ > **Note:** OM currently only supports `@mastra/pg`, `@mastra/libsql`, `@mastra/mysql`, `@mastra/mongodb`, `@mastra/convex`, and `@mastra/oracledb` storage adapters. It uses background agents for managing memory. When no model is set, the default is `model: 'auto'`.
102
+
103
+ ### Automatic models in Mastra Code and Factory
104
+
105
+ Mastra Code and Factory surface the same automatic selection as a per-role **Auto** option in their settings.
106
+
107
+ An automatic Observer or Reflector follows the active main model provider. Mastra Code uses that provider's built-in low-cost Observational Memory model when one is configured. For custom providers and providers without a built-in choice, it uses the active main model. The effective model is resolved when the role runs, so changing the main model doesn't rewrite the saved automatic selection.
108
+
109
+ Select an explicit model to pin one role independently. Reset that role to **Auto** to resume following the main model provider. Existing saved concrete model IDs remain explicit until you reset them.
110
+
111
+ Factory stores automatic intent separately from the effective model shown in settings. A missing provider credential can mark that effective model unavailable, but it doesn't replace the saved selection or prevent Factory from starting.
102
112
 
103
113
  ## Temporal gap markers
104
114
 
@@ -570,11 +580,30 @@ The progress bars update live while the agent is observing or reflecting, showin
570
580
 
571
581
  ## Models
572
582
 
573
- The Observer and Reflector run in the background. Any model that works with Mastra's [model routing](https://mastra.ai/models) (`provider/model`) can be used. When no model is set, the default model is `google/gemini-2.5-flash`.
583
+ The Observer and Reflector run in the background. Any model that works with Mastra's [model routing](https://mastra.ai/models) (`provider/model`) can be used. When no model is set, the default is `model: 'auto'`.
584
+
585
+ Automatic selection uses `google/gemini-2.5-flash` when `GOOGLE_GENERATIVE_AI_API_KEY` is configured. Otherwise, it selects a low-cost model for the active main model's provider, then falls back to the active main model. Observer and Reflector resolve independently before each invocation.
586
+
587
+ Automatic selection reads the main model's `provider/model` ID. Models created from a plain model string carry that ID, and a dynamic model function can label a custom model by returning `{ model, id }`. When the ID is unknown, such as a model with a custom URL, API key, headers, or gateway, automatic selection reuses the main model itself because a sibling model isn't known to share that route. Pass a concrete model ID to the role to override either behavior.
588
+
589
+ Use `autoModels` to change the model picked for a provider, and `resolveModel` to create the picked model with your own credentials or routing:
590
+
591
+ ```typescript
592
+ const memory = new Memory({
593
+ options: {
594
+ observationalMemory: {
595
+ autoModels: { openai: 'openai/gpt-5-nano' },
596
+ resolveModel: (modelId, { requestContext }) => createRoutedModel(modelId, requestContext),
597
+ },
598
+ },
599
+ })
600
+ ```
601
+
602
+ `resolveAutoModelId(mainModelId, { autoModels })` from `@mastra/memory` returns the model automatic selection would pick, which is useful for showing the effective model in a settings UI.
574
603
 
575
604
  Mastra recommends using a model that has a large context window (128K+ tokens) and is fast enough to run in the background without slowing down your actions.
576
605
 
577
- If you're unsure which model to use, start with the default `google/gemini-2.5-flash`. We've also successfully tested `openai/gpt-5-mini`, `anthropic/claude-haiku-4-5`, `deepseek/deepseek-reasoner`, `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`, `xai/grok-4-1-fast`, `qwen3`, and `glm-4.7`.
606
+ To pin a model instead, set a concrete model ID. We've also successfully tested `openai/gpt-5-mini`, `anthropic/claude-haiku-4-5`, `deepseek/deepseek-reasoner`, `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`, `xai/grok-4-1-fast`, `qwen3`, and `glm-4.7`.
578
607
 
579
608
  ```typescript
580
609
  const memory = new Memory({
@@ -95,29 +95,32 @@ Set the `retention` field on the store config.
95
95
 
96
96
  Each domain specifies its age-prunable tables and the timestamp column that anchors comparison, chosen so `maxAge` matches the meaning of the data. Append-only logs use creation time, live state uses last activity, and jobs or runs use completion time so in-flight work isn't pruned.
97
97
 
98
- | Domain | Table key | Anchor column | `maxAge` measures |
99
- | ----------------- | ------------------ | ---------------- | ---------------------------------------------------------------- |
100
- | `memory` | `threads` | `createdAt` | Thread age |
101
- | `memory` | `messages` | `createdAt` | Message age |
102
- | `memory` | `resources` | `createdAt` | Resource age |
103
- | `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives |
104
- | `observability` | `spans` | `startedAt` | Span age |
105
- | `observability` | `metrics` | `timestamp` | Metric event age (vNext only) |
106
- | `observability` | `logs` | `timestamp` | Log event age (vNext only) |
107
- | `observability` | `scores` | `timestamp` | Score event age (vNext only) |
108
- | `observability` | `feedback` | `timestamp` | Feedback event age (vNext only) |
109
- | `scores` | `scorers` | `createdAt` | Score record age |
110
- | `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive |
111
- | `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned |
112
- | `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned |
113
- | `notifications` | `notifications` | `createdAt` | Notification age |
114
- | `harness` | `sessions` | `createdAt` | Session record age |
115
- | `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
98
+ | Domain | Table key | Anchor column | `maxAge` measures |
99
+ | ----------------- | ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
100
+ | `memory` | `threads` | `createdAt` | Thread age |
101
+ | `memory` | `messages` | `createdAt` | Message age |
102
+ | `memory` | `resources` | `createdAt` | Resource age |
103
+ | `memory` | `runFences` | `retiredAt` | Time since the durable agent execution holding the fence settled. Fences of running executions (`NULL`) are never pruned |
104
+ | `threadState` | `threadState` | `updatedAt` | Inactivity: state for still-active threads survives |
105
+ | `observability` | `spans` | `startedAt` | Span age |
106
+ | `observability` | `metrics` | `timestamp` | Metric event age (vNext only) |
107
+ | `observability` | `logs` | `timestamp` | Log event age (vNext only) |
108
+ | `observability` | `scores` | `timestamp` | Score event age (vNext only) |
109
+ | `observability` | `feedback` | `timestamp` | Feedback event age (vNext only) |
110
+ | `scores` | `scorers` | `createdAt` | Score record age |
111
+ | `workflows` | `workflowSnapshot` | `updatedAt` | Inactivity, suspended or long-running workflows survive |
112
+ | `workflows` | `runOwnership` | `updatedAt` | Inactivity. A running durable agent execution renews its claim every 10 seconds, so keep `maxAge` well above its 30-second lease |
113
+ | `backgroundTasks` | `backgroundTasks` | `completedAt` | Time since completion, in-flight tasks (`NULL`) are never pruned |
114
+ | `experiments` | `experiments` | `completedAt` | Time since completion, running experiments are never pruned |
115
+ | `notifications` | `notifications` | `createdAt` | Notification age |
116
+ | `harness` | `sessions` | `createdAt` | Session record age |
117
+ | `schedules` | `triggers` | `actual_fire_at` | Fire-history age (epoch-ms column) |
116
118
 
117
119
  > **Note:**
118
120
  >
119
121
  > - The memory `observational_memory` table has no timestamp anchor, so it can't be age-pruned and isn't a valid retention key.
120
122
  > - Experiments prune as whole units: an aged experiment's result rows are deleted together with it (results cascade with their parent), so a run is never left partially deleted. Retention doesn't have a separate `results` key.
123
+ > - `runOwnership` and `runFences` hold the run fencing records of durable agents, one small record per run in each. If the `runOwnership` `maxAge` is too short, a running execution can lose its run, but an execution that lost a run still can't write. A fence is retired only when its execution settles, so the fence of a run that crashed and was never recovered is never pruned.
121
124
  > - For `schedules`, the growth table is the fire history (`schedule_triggers`, one row per fire): schedule definitions are config and aren't pruned.
122
125
  > - On PostgreSQL, timestamp anchors use the timezone-aware mirror columns (for example `createdAtZ`, `completedAtZ`).
123
126
  > - DuckDB observability stores append-only events for all five signals. Its `spans` policy uses the event `timestamp` column rather than `startedAt`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/oracledb",
3
- "version": "0.5.1-alpha.0",
3
+ "version": "0.5.1",
4
4
  "description": "Oracle Database provider for Mastra storage and vector retrieval",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,9 +32,9 @@
32
32
  "tsx": "^4.23.1",
33
33
  "typescript": "^7.0.2",
34
34
  "vitest": "4.1.11",
35
- "@internal/lint": "0.0.141",
36
- "@mastra/core": "1.76.0-alpha.2",
37
- "@internal/types-builder": "0.0.116"
35
+ "@internal/lint": "0.0.142",
36
+ "@internal/types-builder": "0.0.117",
37
+ "@mastra/core": "1.76.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@mastra/core": ">=1.68.0-0 <2.0.0-0"