@mastra/rag 0.0.2-alpha.46 → 0.0.2-alpha.49

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @mastra/rag
2
2
 
3
+ ## 0.0.2-alpha.49
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f368477]
8
+ - Updated dependencies [d5ec619]
9
+ - @mastra/core@0.1.27-alpha.64
10
+
11
+ ## 0.0.2-alpha.48
12
+
13
+ ### Patch Changes
14
+
15
+ - 5826db3: Updated reference docs and exports for Reranker and GraphRag
16
+
17
+ ## 0.0.2-alpha.47
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [e097800]
22
+ - @mastra/core@0.1.27-alpha.63
23
+
3
24
  ## 0.0.2-alpha.46
4
25
 
5
26
  ### Patch Changes
@@ -3556,7 +3556,7 @@ var GraphRAG = /*#__PURE__*/function () {
3556
3556
  var similarity = dotProduct / magnitudeProduct;
3557
3557
  return Math.max(-1, Math.min(1, similarity));
3558
3558
  };
3559
- _proto.processResults = function processResults(chunks, embeddings) {
3559
+ _proto.createGraph = function createGraph(chunks, embeddings) {
3560
3560
  var _this = this;
3561
3561
  if (!(chunks != null && chunks.length) || !(embeddings != null && embeddings.length)) {
3562
3562
  throw new Error('Chunks and embeddings arrays must not be empty');
@@ -3731,8 +3731,8 @@ var DEFAULT_WEIGHTS = {
3731
3731
  position: 0.2
3732
3732
  };
3733
3733
  // Takes in a list of results from a vector store and reranks them based on semantic, vector, and position scores
3734
- var RagReranker = /*#__PURE__*/function () {
3735
- function RagReranker(options) {
3734
+ var Reranker = /*#__PURE__*/function () {
3735
+ function Reranker(options) {
3736
3736
  this.semanticProvider = void 0;
3737
3737
  this.weights = void 0;
3738
3738
  // Set up different weights for scoring components. Uses default weights if not provided
@@ -3752,7 +3752,7 @@ var RagReranker = /*#__PURE__*/function () {
3752
3752
  }
3753
3753
  }
3754
3754
  // Calculate position score based on position in original list
3755
- var _proto = RagReranker.prototype;
3755
+ var _proto = Reranker.prototype;
3756
3756
  _proto.calculatePositionScore = function calculatePositionScore(position, totalChunks) {
3757
3757
  return 1 - position / totalChunks;
3758
3758
  }
@@ -3855,7 +3855,7 @@ var RagReranker = /*#__PURE__*/function () {
3855
3855
  }
3856
3856
  return rerank;
3857
3857
  }();
3858
- return RagReranker;
3858
+ return Reranker;
3859
3859
  }();
3860
3860
 
3861
3861
  var createFilter = function createFilter(filter, vectorFilterType) {
@@ -3966,7 +3966,7 @@ var createVectorQueryTool = function createVectorQueryTool(_ref5) {
3966
3966
  _context2.next = 17;
3967
3967
  break;
3968
3968
  }
3969
- reranker = new RagReranker(rerankOptions);
3969
+ reranker = new Reranker(rerankOptions);
3970
3970
  _context2.next = 13;
3971
3971
  return reranker.rerank({
3972
3972
  query: queryText,
@@ -4083,7 +4083,7 @@ var createGraphRAGTool = function createGraphRAGTool(_ref8) {
4083
4083
  vector: result.vector || []
4084
4084
  };
4085
4085
  });
4086
- graphRag.processResults(chunks, embeddings);
4086
+ graphRag.createGraph(chunks, embeddings);
4087
4087
  isInitialized = true;
4088
4088
  }
4089
4089
  // Get reranked results using GraphRAG
@@ -4150,11 +4150,12 @@ var createDocumentChunker = function createDocumentChunker(_ref10) {
4150
4150
  };
4151
4151
 
4152
4152
  exports.AstraVector = AstraVector;
4153
+ exports.GraphRAG = GraphRAG;
4153
4154
  exports.MDocument = MDocument;
4154
4155
  exports.PgVector = PgVector;
4155
4156
  exports.PineconeVector = PineconeVector;
4156
4157
  exports.QdrantVector = QdrantVector;
4157
- exports.RagReranker = RagReranker;
4158
+ exports.Reranker = Reranker;
4158
4159
  exports.UpstashVector = UpstashVector;
4159
4160
  exports.createDocumentChunker = createDocumentChunker;
4160
4161
  exports.createGraphRAGTool = createGraphRAGTool;