@mastra/oracledb 0.0.0-aggregate-trace-20261015182851

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.
Files changed (98) hide show
  1. package/LICENSE.md +32 -0
  2. package/README.md +70 -0
  3. package/dist/_types/@internal_core/dist/memory/index.d.ts +102 -0
  4. package/dist/_types/@internal_core/package.json +1 -0
  5. package/dist/docs/SKILL.md +38 -0
  6. package/dist/docs/assets/SOURCE_MAP.json +6 -0
  7. package/dist/docs/references/docs-memory-observational-memory.md +1016 -0
  8. package/dist/docs/references/docs-memory-semantic-recall.md +455 -0
  9. package/dist/docs/references/docs-memory-working-memory.md +450 -0
  10. package/dist/docs/references/docs-storage.md +224 -0
  11. package/dist/docs/references/integrations-databases-oracledb.md +241 -0
  12. package/dist/docs/references/reference-rag-metadata-filters.md +238 -0
  13. package/dist/docs/references/reference-rag-overview.md +76 -0
  14. package/dist/docs/references/reference-rag-retrieval.md +657 -0
  15. package/dist/docs/references/reference-rag-vector-databases.md +808 -0
  16. package/dist/docs/references/reference-storage-retention.md +310 -0
  17. package/dist/docs/references/reference-vectors-oracledb.md +349 -0
  18. package/dist/index.cjs +9785 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.ts +7 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +9746 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/schema.d.ts +27 -0
  25. package/dist/schema.d.ts.map +1 -0
  26. package/dist/shared/connection.d.ts +46 -0
  27. package/dist/shared/connection.d.ts.map +1 -0
  28. package/dist/storage/db/index.d.ts +134 -0
  29. package/dist/storage/db/index.d.ts.map +1 -0
  30. package/dist/storage/db/run-fencing.d.ts +32 -0
  31. package/dist/storage/db/run-fencing.d.ts.map +1 -0
  32. package/dist/storage/domain-utils.d.ts +18 -0
  33. package/dist/storage/domain-utils.d.ts.map +1 -0
  34. package/dist/storage/domains/agents/index.d.ts +54 -0
  35. package/dist/storage/domains/agents/index.d.ts.map +1 -0
  36. package/dist/storage/domains/mcp-clients/index.d.ts +46 -0
  37. package/dist/storage/domains/mcp-clients/index.d.ts.map +1 -0
  38. package/dist/storage/domains/memory/index.d.ts +121 -0
  39. package/dist/storage/domains/memory/index.d.ts.map +1 -0
  40. package/dist/storage/domains/memory/messages.d.ts +39 -0
  41. package/dist/storage/domains/memory/messages.d.ts.map +1 -0
  42. package/dist/storage/domains/memory/observational-buffering.d.ts +8 -0
  43. package/dist/storage/domains/memory/observational-buffering.d.ts.map +1 -0
  44. package/dist/storage/domains/memory/observational.d.ts +78 -0
  45. package/dist/storage/domains/memory/observational.d.ts.map +1 -0
  46. package/dist/storage/domains/memory/resources.d.ts +15 -0
  47. package/dist/storage/domains/memory/resources.d.ts.map +1 -0
  48. package/dist/storage/domains/memory/schema.d.ts +54 -0
  49. package/dist/storage/domains/memory/schema.d.ts.map +1 -0
  50. package/dist/storage/domains/memory/threads.d.ts +43 -0
  51. package/dist/storage/domains/memory/threads.d.ts.map +1 -0
  52. package/dist/storage/domains/memory/utils.d.ts +81 -0
  53. package/dist/storage/domains/memory/utils.d.ts.map +1 -0
  54. package/dist/storage/domains/observability/binds.d.ts +21 -0
  55. package/dist/storage/domains/observability/binds.d.ts.map +1 -0
  56. package/dist/storage/domains/observability/index.d.ts +53 -0
  57. package/dist/storage/domains/observability/index.d.ts.map +1 -0
  58. package/dist/storage/domains/observability/logs.d.ts +5 -0
  59. package/dist/storage/domains/observability/logs.d.ts.map +1 -0
  60. package/dist/storage/domains/observability/schema.d.ts +38 -0
  61. package/dist/storage/domains/observability/schema.d.ts.map +1 -0
  62. package/dist/storage/domains/observability/scores-bridge.d.ts +13 -0
  63. package/dist/storage/domains/observability/scores-bridge.d.ts.map +1 -0
  64. package/dist/storage/domains/observability/spans.d.ts +18 -0
  65. package/dist/storage/domains/observability/spans.d.ts.map +1 -0
  66. package/dist/storage/domains/scorer-definitions/index.d.ts +46 -0
  67. package/dist/storage/domains/scorer-definitions/index.d.ts.map +1 -0
  68. package/dist/storage/domains/scores/index.d.ts +63 -0
  69. package/dist/storage/domains/scores/index.d.ts.map +1 -0
  70. package/dist/storage/domains/workflows/index.d.ts +82 -0
  71. package/dist/storage/domains/workflows/index.d.ts.map +1 -0
  72. package/dist/storage/index.d.ts +45 -0
  73. package/dist/storage/index.d.ts.map +1 -0
  74. package/dist/storage/migrations.d.ts +55 -0
  75. package/dist/storage/migrations.d.ts.map +1 -0
  76. package/dist/storage/types.d.ts +44 -0
  77. package/dist/storage/types.d.ts.map +1 -0
  78. package/dist/vector/ddl.d.ts +58 -0
  79. package/dist/vector/ddl.d.ts.map +1 -0
  80. package/dist/vector/filter.d.ts +7 -0
  81. package/dist/vector/filter.d.ts.map +1 -0
  82. package/dist/vector/identifiers.d.ts +11 -0
  83. package/dist/vector/identifiers.d.ts.map +1 -0
  84. package/dist/vector/index.d.ts +32 -0
  85. package/dist/vector/index.d.ts.map +1 -0
  86. package/dist/vector/prompt.d.ts +6 -0
  87. package/dist/vector/prompt.d.ts.map +1 -0
  88. package/dist/vector/query.d.ts +5 -0
  89. package/dist/vector/query.d.ts.map +1 -0
  90. package/dist/vector/sql.d.ts +12 -0
  91. package/dist/vector/sql.d.ts.map +1 -0
  92. package/dist/vector/stats.d.ts +9 -0
  93. package/dist/vector/stats.d.ts.map +1 -0
  94. package/dist/vector/types.d.ts +80 -0
  95. package/dist/vector/types.d.ts.map +1 -0
  96. package/dist/vector/upsert.d.ts +20 -0
  97. package/dist/vector/upsert.d.ts.map +1 -0
  98. package/package.json +71 -0
package/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named `ee/` within this
4
+ repository, including but not limited to:
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
10
+
11
+ - All third-party components incorporated into the Mastra Software are
12
+ licensed under the original license provided by the owner of the
13
+ applicable component.
14
+
15
+ - Content outside of the above-mentioned directories or restrictions is
16
+ available under the "Apache License 2.0" as defined below.
17
+
18
+ # Apache License 2.0
19
+
20
+ Copyright (c) 2025 Kepler Software, Inc.
21
+
22
+ Licensed under the Apache License, Version 2.0 (the "License");
23
+ you may not use this file except in compliance with the License.
24
+ You may obtain a copy of the License at
25
+
26
+ http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ Unless required by applicable law or agreed to in writing, software
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ See the License for the specific language governing permissions and
32
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # @mastra/oracledb
2
+
3
+ Oracle Database provider for Mastra, providing storage and vector similarity search with Oracle JSON, Oracle `VECTOR`, connection pooling, and transaction support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/oracledb
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Storage
14
+
15
+ ```typescript
16
+ import { OracleStore } from '@mastra/oracledb';
17
+
18
+ const store = new OracleStore({
19
+ id: 'oracle-store',
20
+ user: process.env.ORACLE_DATABASE_USER,
21
+ password: process.env.ORACLE_DATABASE_PASSWORD,
22
+ connectString: process.env.ORACLE_DATABASE_CONNECT_STRING,
23
+ });
24
+
25
+ await store.init();
26
+ const memory = await store.getStore('memory');
27
+ if (!memory) throw new Error('Oracle memory store is not available');
28
+
29
+ // Create a thread
30
+ await memory.saveThread({
31
+ thread: {
32
+ id: 'thread-123',
33
+ resourceId: 'resource-456',
34
+ title: 'My Thread',
35
+ metadata: { key: 'value' },
36
+ createdAt: new Date(),
37
+ },
38
+ });
39
+
40
+ // Add messages to thread
41
+ await memory.saveMessages({
42
+ messages: [
43
+ {
44
+ id: 'msg-789',
45
+ threadId: 'thread-123',
46
+ role: 'user',
47
+ content: { content: 'Hello' },
48
+ resourceId: 'resource-456',
49
+ createdAt: new Date(),
50
+ },
51
+ ],
52
+ });
53
+
54
+ // Query threads and messages
55
+ const savedThread = await memory.getThreadById({ threadId: 'thread-123' });
56
+ const { messages } = await memory.listMessages({ threadId: 'thread-123' });
57
+ ```
58
+
59
+ ## Documentation
60
+
61
+ - [Oracle Database integration guide](https://mastra.ai/integrations/databases/oracledb)
62
+ - [Oracle Database vector reference](https://mastra.ai/reference/vectors/oracledb)
63
+
64
+ ## Changelog
65
+
66
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/stores/oracledb/CHANGELOG.md) for version history and release notes.
67
+
68
+ ## Support
69
+
70
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
@@ -0,0 +1,102 @@
1
+ //#region src/memory/index.d.ts
2
+ /**
3
+ * Shared rules for observational memory lifecycle writes. Every storage adapter applies
4
+ * these inside its own atomic section (lock, transaction, or conditional update), so the
5
+ * decisions are identical across adapters.
6
+ */
7
+ /**
8
+ * Observational memory columns that lifecycle writes depend on. Storage adapters merge these
9
+ * into the table schema they get from `@mastra/core`, so the columns exist even when the
10
+ * installed core predates them.
11
+ */
12
+ declare const OBSERVATIONAL_MEMORY_LIFECYCLE_COLUMNS: {
13
+ readonly supersededBy: {
14
+ readonly type: 'text';
15
+ readonly nullable: true;
16
+ };
17
+ };
18
+ /** `schema` plus {@link OBSERVATIONAL_MEMORY_LIFECYCLE_COLUMNS}; `undefined` when `schema` is. */
19
+ declare function withObservationalMemoryLifecycleColumns<T extends object>(schema: T | undefined): (T & typeof OBSERVATIONAL_MEMORY_LIFECYCLE_COLUMNS) | undefined;
20
+ /**
21
+ * Result of `commitActiveObservations`.
22
+ */
23
+ interface UpdateActiveObservationsResult {
24
+ /** Whether the observations were written. */
25
+ applied: boolean;
26
+ /**
27
+ * Why nothing was written: `retired` — the target record was superseded by a newer
28
+ * generation; `conflict` — `expectedActiveObservations` no longer matches the stored text.
29
+ */
30
+ reason?: 'retired' | 'conflict';
31
+ }
32
+ /**
33
+ * Result of `appendBufferedObservations`.
34
+ *
35
+ * The append targets the head generation: when `input.id` was superseded, the chunk is
36
+ * appended to the current head instead. The append is skipped (`persisted: false`) when the
37
+ * head already holds a chunk with the same `cycleId`, or when the chunk is wholly covered by
38
+ * the head's cursor. Chunks carry `lastObservedAt = max message time + 1ms`, so a chunk is
39
+ * wholly covered iff `head.lastObservedAt >= chunk.lastObservedAt - 1ms`.
40
+ */
41
+ interface UpdateBufferedObservationsResult {
42
+ /** Whether the chunk was stored. */
43
+ persisted: boolean;
44
+ /** The record the chunk was written to (or would have been written to). */
45
+ recordId: string;
46
+ }
47
+ /** The fields of an observational memory record that decide head order. */
48
+ interface ObservationalMemoryHeadOrderFields {
49
+ generationCount: number;
50
+ createdAt: Date | string;
51
+ id: string;
52
+ }
53
+ /**
54
+ * Canonical head order: `generationCount DESC, createdAt ASC, id ASC`.
55
+ * Returns a negative number when `a` sorts before `b` (i.e. `a` is the better head candidate).
56
+ */
57
+ declare function compareObservationalMemoryHeadOrder(a: ObservationalMemoryHeadOrderFields, b: ObservationalMemoryHeadOrderFields): number;
58
+ /**
59
+ * A buffered chunk stores `lastObservedAt = max message time + 1ms`. It is wholly covered
60
+ * (every message it observed is already at or before the cursor) iff
61
+ * `cursor >= chunk.lastObservedAt - 1ms`.
62
+ */
63
+ declare function isBufferedChunkCoveredByCursor(chunkLastObservedAt: Date | string, cursor: Date | string | null | undefined): boolean;
64
+ /** The later of two cursors; `undefined` only when both are absent. */
65
+ declare function maxObservationCursor(a: Date | string | null | undefined, b: Date | string | null | undefined): Date | undefined;
66
+ interface ReflectionTextPlan {
67
+ /** `equal`: stored text equals the snapshot. `append`: observations were appended after the snapshot. */
68
+ mode: 'equal' | 'append';
69
+ observations: string;
70
+ tokenCount: number;
71
+ }
72
+ /**
73
+ * Decide the new generation's text when a reflection built from `snapshot` commits against
74
+ * the stored record.
75
+ *
76
+ * - Stored text equals the snapshot: the reflection replaces it.
77
+ * - Stored text extends the snapshot (activation only appends): the appended tail is kept
78
+ * after the reflection, and its tokens are added.
79
+ * - Anything else (a non-append rewrite): `null` — the reflection must not be applied.
80
+ */
81
+ declare function planReflectionGenerationText(input: {
82
+ storedObservations: string;
83
+ storedObservationTokenCount: number;
84
+ snapshotObservations: string;
85
+ snapshotObservationTokenCount: number;
86
+ reflection: string;
87
+ tokenCount: number;
88
+ }): ReflectionTextPlan | null;
89
+ /**
90
+ * Backs `updateActiveObservations` in adapters that implement `commitActiveObservations`.
91
+ * Callers of `updateActiveObservations` (which resolves `void`) can't see a commit result, so a
92
+ * write that was not applied throws instead of resolving as if it had committed.
93
+ */
94
+ declare function assertActiveObservationsApplied(result: UpdateActiveObservationsResult, id: string): void;
95
+ /**
96
+ * Whether the stored text can still accept a reflection built from `snapshot`
97
+ * (equal, or only appended to since).
98
+ */
99
+ declare function isAppendOnlySince(storedObservations: string, snapshotObservations: string): boolean;
100
+ //#endregion
101
+ export { OBSERVATIONAL_MEMORY_LIFECYCLE_COLUMNS, ObservationalMemoryHeadOrderFields, ReflectionTextPlan, UpdateActiveObservationsResult, UpdateBufferedObservationsResult, assertActiveObservationsApplied, compareObservationalMemoryHeadOrder, isAppendOnlySince, isBufferedChunkCoveredByCursor, maxObservationCursor, planReflectionGenerationText, withObservationalMemoryLifecycleColumns };
102
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: mastra-oracledb
3
+ description: Documentation for @mastra/oracledb. Use when working with @mastra/oracledb APIs, configuration, or implementation.
4
+ metadata:
5
+ package: "@mastra/oracledb"
6
+ version: "0.0.0-aggregate-trace-20261015182851"
7
+ ---
8
+
9
+ ## When to use
10
+
11
+ Use this skill whenever you are working with @mastra/oracledb to obtain the domain-specific knowledge.
12
+
13
+ ## How to use
14
+
15
+ Read the individual reference documents for detailed explanations and code examples.
16
+
17
+ ### Docs
18
+
19
+ - [Observational Memory](references/docs-memory-observational-memory.md) - Configure Mastra Observational Memory to compress long conversations into durable observations while preserving context across threads and sessions.
20
+ - [Semantic recall](references/docs-memory-semantic-recall.md) - Retrieve relevant messages from past Mastra conversations with semantic recall, vector search, embeddings, metadata filters, and configurable storage.
21
+ - [Working memory](references/docs-memory-working-memory.md) - Persist user profiles, preferences, and application data with Mastra working memory using resource- or thread-scoped templates and storage adapters.
22
+ - [Storage](references/docs-storage.md) - Configure Mastra storage to persist memory, workflow state, observability data, evals, schedules, and long-running agent state across restarts.
23
+
24
+ ### Integrations
25
+
26
+ - [OracleDB](references/integrations-databases-oracledb.md) - Persist Mastra memory, workflows, observability, scores, MCP metadata, and agent registry data in Oracle Database with OracleStore.
27
+
28
+ ### Reference
29
+
30
+ - [Reference: Metadata filters](references/reference-rag-metadata-filters.md) - Mastra provides a unified metadata filtering syntax across all vector stores, based on MongoDB/Sift query syntax.
31
+ - [RAG (Retrieval-Augmented Generation) in Mastra](references/reference-rag-overview.md) - RAG in Mastra helps you enhance LLM outputs by incorporating relevant context from your own data sources, improving accuracy and grounding responses in real information.
32
+ - [Retrieval, semantic search, reranking](references/reference-rag-retrieval.md) - After storing embeddings, you need to retrieve relevant chunks to answer user queries.
33
+ - [Storing embeddings in a vector database](references/reference-rag-vector-databases.md) - After generating embeddings, you need to store them in a database that supports vector similarity search.
34
+ - [Reference: Storage retention (prune)](references/reference-storage-retention.md) - prune() deletes rows. It caps growth and is safe to run against large tables (batched, bounded, resumable, cancellable).
35
+ - [Reference: OracleDB vector store](references/reference-vectors-oracledb.md) - OracleVector stores embeddings in Oracle Database VECTOR columns and exposes them through Mastra's vector interface.
36
+
37
+
38
+ Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": "0.0.0-aggregate-trace-20261015182851",
3
+ "package": "@mastra/oracledb",
4
+ "exports": {},
5
+ "modules": {}
6
+ }