@pleaseai/context-please-core 0.1.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.
Files changed (116) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +287 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/context.d.ts +276 -0
  5. package/dist/context.d.ts.map +1 -0
  6. package/dist/context.js +1072 -0
  7. package/dist/context.js.map +1 -0
  8. package/dist/embedding/base-embedding.d.ts +51 -0
  9. package/dist/embedding/base-embedding.d.ts.map +1 -0
  10. package/dist/embedding/base-embedding.js +36 -0
  11. package/dist/embedding/base-embedding.js.map +1 -0
  12. package/dist/embedding/gemini-embedding.d.ts +53 -0
  13. package/dist/embedding/gemini-embedding.d.ts.map +1 -0
  14. package/dist/embedding/gemini-embedding.js +152 -0
  15. package/dist/embedding/gemini-embedding.js.map +1 -0
  16. package/dist/embedding/index.d.ts +6 -0
  17. package/dist/embedding/index.d.ts.map +1 -0
  18. package/dist/embedding/index.js +24 -0
  19. package/dist/embedding/index.js.map +1 -0
  20. package/dist/embedding/ollama-embedding.d.ts +55 -0
  21. package/dist/embedding/ollama-embedding.d.ts.map +1 -0
  22. package/dist/embedding/ollama-embedding.js +192 -0
  23. package/dist/embedding/ollama-embedding.js.map +1 -0
  24. package/dist/embedding/openai-embedding.d.ts +36 -0
  25. package/dist/embedding/openai-embedding.d.ts.map +1 -0
  26. package/dist/embedding/openai-embedding.js +159 -0
  27. package/dist/embedding/openai-embedding.js.map +1 -0
  28. package/dist/embedding/voyageai-embedding.d.ts +44 -0
  29. package/dist/embedding/voyageai-embedding.d.ts.map +1 -0
  30. package/dist/embedding/voyageai-embedding.js +227 -0
  31. package/dist/embedding/voyageai-embedding.js.map +1 -0
  32. package/dist/index.d.ts +8 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +24 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/splitter/ast-splitter.d.ts +22 -0
  37. package/dist/splitter/ast-splitter.d.ts.map +1 -0
  38. package/dist/splitter/ast-splitter.js +234 -0
  39. package/dist/splitter/ast-splitter.js.map +1 -0
  40. package/dist/splitter/index.d.ts +41 -0
  41. package/dist/splitter/index.d.ts.map +1 -0
  42. package/dist/splitter/index.js +27 -0
  43. package/dist/splitter/index.js.map +1 -0
  44. package/dist/splitter/langchain-splitter.d.ts +13 -0
  45. package/dist/splitter/langchain-splitter.d.ts.map +1 -0
  46. package/dist/splitter/langchain-splitter.js +118 -0
  47. package/dist/splitter/langchain-splitter.js.map +1 -0
  48. package/dist/sync/merkle.d.ts +26 -0
  49. package/dist/sync/merkle.d.ts.map +1 -0
  50. package/dist/sync/merkle.js +112 -0
  51. package/dist/sync/merkle.js.map +1 -0
  52. package/dist/sync/synchronizer.d.ts +30 -0
  53. package/dist/sync/synchronizer.d.ts.map +1 -0
  54. package/dist/sync/synchronizer.js +339 -0
  55. package/dist/sync/synchronizer.js.map +1 -0
  56. package/dist/types.d.ts +14 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/dist/types.js +3 -0
  59. package/dist/types.js.map +1 -0
  60. package/dist/utils/env-manager.d.ts +19 -0
  61. package/dist/utils/env-manager.d.ts.map +1 -0
  62. package/dist/utils/env-manager.js +125 -0
  63. package/dist/utils/env-manager.js.map +1 -0
  64. package/dist/utils/index.d.ts +2 -0
  65. package/dist/utils/index.d.ts.map +1 -0
  66. package/dist/utils/index.js +7 -0
  67. package/dist/utils/index.js.map +1 -0
  68. package/dist/vectordb/base/base-vector-database.d.ts +58 -0
  69. package/dist/vectordb/base/base-vector-database.d.ts.map +1 -0
  70. package/dist/vectordb/base/base-vector-database.js +32 -0
  71. package/dist/vectordb/base/base-vector-database.js.map +1 -0
  72. package/dist/vectordb/factory.d.ts +80 -0
  73. package/dist/vectordb/factory.d.ts.map +1 -0
  74. package/dist/vectordb/factory.js +89 -0
  75. package/dist/vectordb/factory.js.map +1 -0
  76. package/dist/vectordb/index.d.ts +12 -0
  77. package/dist/vectordb/index.d.ts.map +1 -0
  78. package/dist/vectordb/index.js +27 -0
  79. package/dist/vectordb/index.js.map +1 -0
  80. package/dist/vectordb/milvus-restful-vectordb.d.ts +75 -0
  81. package/dist/vectordb/milvus-restful-vectordb.d.ts.map +1 -0
  82. package/dist/vectordb/milvus-restful-vectordb.js +707 -0
  83. package/dist/vectordb/milvus-restful-vectordb.js.map +1 -0
  84. package/dist/vectordb/milvus-vectordb.d.ts +59 -0
  85. package/dist/vectordb/milvus-vectordb.d.ts.map +1 -0
  86. package/dist/vectordb/milvus-vectordb.js +641 -0
  87. package/dist/vectordb/milvus-vectordb.js.map +1 -0
  88. package/dist/vectordb/qdrant-vectordb.d.ts +124 -0
  89. package/dist/vectordb/qdrant-vectordb.d.ts.map +1 -0
  90. package/dist/vectordb/qdrant-vectordb.js +582 -0
  91. package/dist/vectordb/qdrant-vectordb.js.map +1 -0
  92. package/dist/vectordb/sparse/index.d.ts +4 -0
  93. package/dist/vectordb/sparse/index.d.ts.map +1 -0
  94. package/dist/vectordb/sparse/index.js +23 -0
  95. package/dist/vectordb/sparse/index.js.map +1 -0
  96. package/dist/vectordb/sparse/simple-bm25.d.ts +104 -0
  97. package/dist/vectordb/sparse/simple-bm25.d.ts.map +1 -0
  98. package/dist/vectordb/sparse/simple-bm25.js +189 -0
  99. package/dist/vectordb/sparse/simple-bm25.js.map +1 -0
  100. package/dist/vectordb/sparse/sparse-vector-generator.d.ts +54 -0
  101. package/dist/vectordb/sparse/sparse-vector-generator.d.ts.map +1 -0
  102. package/dist/vectordb/sparse/sparse-vector-generator.js +3 -0
  103. package/dist/vectordb/sparse/sparse-vector-generator.js.map +1 -0
  104. package/dist/vectordb/sparse/types.d.ts +38 -0
  105. package/dist/vectordb/sparse/types.d.ts.map +1 -0
  106. package/dist/vectordb/sparse/types.js +3 -0
  107. package/dist/vectordb/sparse/types.js.map +1 -0
  108. package/dist/vectordb/types.d.ts +120 -0
  109. package/dist/vectordb/types.d.ts.map +1 -0
  110. package/dist/vectordb/types.js +9 -0
  111. package/dist/vectordb/types.js.map +1 -0
  112. package/dist/vectordb/zilliz-utils.d.ts +135 -0
  113. package/dist/vectordb/zilliz-utils.d.ts.map +1 -0
  114. package/dist/vectordb/zilliz-utils.js +192 -0
  115. package/dist/vectordb/zilliz-utils.js.map +1 -0
  116. package/package.json +61 -0
@@ -0,0 +1,104 @@
1
+ import { SparseVectorGenerator } from './sparse-vector-generator';
2
+ import { SparseVector, SparseVectorConfig } from './types';
3
+ /**
4
+ * Configuration for BM25 algorithm
5
+ */
6
+ export interface BM25Config {
7
+ /**
8
+ * Term frequency saturation parameter
9
+ * Controls how quickly term frequency impact saturates
10
+ * @default 1.2
11
+ */
12
+ k1?: number;
13
+ /**
14
+ * Length normalization parameter
15
+ * 0 = no normalization, 1 = full normalization
16
+ * @default 0.75
17
+ */
18
+ b?: number;
19
+ /**
20
+ * Minimum term length to include
21
+ * @default 2
22
+ */
23
+ minTermLength?: number;
24
+ /**
25
+ * Stop words to exclude
26
+ * @default []
27
+ */
28
+ stopWords?: Set<string>;
29
+ }
30
+ /**
31
+ * Simple BM25 implementation for sparse vector generation
32
+ *
33
+ * BM25 (Best Matching 25) is a probabilistic ranking function
34
+ * used for information retrieval and text search.
35
+ *
36
+ * Formula:
37
+ * score(D,Q) = Σ IDF(qi) × (f(qi,D) × (k1 + 1)) / (f(qi,D) + k1 × (1 - b + b × |D| / avgdl))
38
+ *
39
+ * Where:
40
+ * - D = document
41
+ * - Q = query
42
+ * - qi = query term i
43
+ * - f(qi,D) = term frequency in document
44
+ * - |D| = document length
45
+ * - avgdl = average document length
46
+ * - IDF(qi) = inverse document frequency
47
+ */
48
+ export declare class SimpleBM25 implements SparseVectorGenerator {
49
+ private k1;
50
+ private b;
51
+ private minTermLength;
52
+ private stopWords;
53
+ private vocabulary;
54
+ private idf;
55
+ private avgDocLength;
56
+ private trained;
57
+ constructor(config?: BM25Config);
58
+ /**
59
+ * Tokenize text into terms
60
+ * Simple but effective tokenization:
61
+ * 1. Lowercase
62
+ * 2. Remove special characters
63
+ * 3. Split on whitespace
64
+ * 4. Filter by length and stop words
65
+ */
66
+ private tokenize;
67
+ /**
68
+ * Calculate term frequency for a document
69
+ */
70
+ private calculateTermFrequency;
71
+ /**
72
+ * Learn vocabulary and IDF from corpus
73
+ */
74
+ learn(documents: string[]): void;
75
+ /**
76
+ * Generate sparse vector for a single text
77
+ */
78
+ generate(text: string, config?: SparseVectorConfig): SparseVector;
79
+ /**
80
+ * Generate sparse vectors for multiple texts (batch operation)
81
+ */
82
+ generateBatch(texts: string[], config?: SparseVectorConfig): SparseVector[];
83
+ /**
84
+ * Get vocabulary size
85
+ */
86
+ getVocabularySize(): number;
87
+ /**
88
+ * Get average document length
89
+ */
90
+ getAverageDocumentLength(): number;
91
+ /**
92
+ * Check if trained
93
+ */
94
+ isTrained(): boolean;
95
+ /**
96
+ * Get the vocabulary (for debugging/inspection)
97
+ */
98
+ getVocabulary(): Map<string, number>;
99
+ /**
100
+ * Get IDF scores (for debugging/inspection)
101
+ */
102
+ getIDFScores(): Map<string, number>;
103
+ }
104
+ //# sourceMappingURL=simple-bm25.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-bm25.d.ts","sourceRoot":"","sources":["../../../src/vectordb/sparse/simple-bm25.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;OAIG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,UAAW,YAAW,qBAAqB;IACpD,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,CAAC,CAAS;IAClB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAc;IAG/B,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,GAAG,CAAkC;IAC7C,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,OAAO,CAAkB;gBAErB,MAAM,GAAE,UAAe;IAOnC;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;IAWhB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;OAEG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IA8ChC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY;IA+DjE;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY,EAAE;IAI3E;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAI3B;;OAEG;IACH,wBAAwB,IAAI,MAAM;IAIlC;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAIpC;;OAEG;IACH,YAAY,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAGtC"}
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimpleBM25 = void 0;
4
+ /**
5
+ * Simple BM25 implementation for sparse vector generation
6
+ *
7
+ * BM25 (Best Matching 25) is a probabilistic ranking function
8
+ * used for information retrieval and text search.
9
+ *
10
+ * Formula:
11
+ * score(D,Q) = Σ IDF(qi) × (f(qi,D) × (k1 + 1)) / (f(qi,D) + k1 × (1 - b + b × |D| / avgdl))
12
+ *
13
+ * Where:
14
+ * - D = document
15
+ * - Q = query
16
+ * - qi = query term i
17
+ * - f(qi,D) = term frequency in document
18
+ * - |D| = document length
19
+ * - avgdl = average document length
20
+ * - IDF(qi) = inverse document frequency
21
+ */
22
+ class SimpleBM25 {
23
+ constructor(config = {}) {
24
+ // Learned from corpus
25
+ this.vocabulary = new Map();
26
+ this.idf = new Map();
27
+ this.avgDocLength = 0;
28
+ this.trained = false;
29
+ this.k1 = config.k1 ?? 1.2;
30
+ this.b = config.b ?? 0.75;
31
+ this.minTermLength = config.minTermLength ?? 2;
32
+ this.stopWords = config.stopWords ?? new Set();
33
+ }
34
+ /**
35
+ * Tokenize text into terms
36
+ * Simple but effective tokenization:
37
+ * 1. Lowercase
38
+ * 2. Remove special characters
39
+ * 3. Split on whitespace
40
+ * 4. Filter by length and stop words
41
+ */
42
+ tokenize(text) {
43
+ return text
44
+ .toLowerCase()
45
+ .replace(/[^\w\s]/g, ' ')
46
+ .split(/\s+/)
47
+ .filter(term => term.length >= this.minTermLength &&
48
+ !this.stopWords.has(term));
49
+ }
50
+ /**
51
+ * Calculate term frequency for a document
52
+ */
53
+ calculateTermFrequency(tokens) {
54
+ const termFreq = new Map();
55
+ tokens.forEach(token => {
56
+ termFreq.set(token, (termFreq.get(token) || 0) + 1);
57
+ });
58
+ return termFreq;
59
+ }
60
+ /**
61
+ * Learn vocabulary and IDF from corpus
62
+ */
63
+ learn(documents) {
64
+ if (documents.length === 0) {
65
+ throw new Error('Cannot learn from empty corpus');
66
+ }
67
+ // Reset state
68
+ this.vocabulary.clear();
69
+ this.idf.clear();
70
+ // Tokenize all documents
71
+ const tokenizedDocs = documents.map(doc => this.tokenize(doc));
72
+ // Calculate average document length
73
+ const totalLength = tokenizedDocs.reduce((sum, tokens) => sum + tokens.length, 0);
74
+ this.avgDocLength = totalLength / tokenizedDocs.length;
75
+ // Calculate document frequency for each term
76
+ const docFreq = new Map();
77
+ tokenizedDocs.forEach(tokens => {
78
+ const uniqueTerms = new Set(tokens);
79
+ uniqueTerms.forEach(term => {
80
+ docFreq.set(term, (docFreq.get(term) || 0) + 1);
81
+ });
82
+ });
83
+ // Build vocabulary and calculate IDF
84
+ // IDF formula: log((N - df + 0.5) / (df + 0.5))
85
+ const numDocs = documents.length;
86
+ let vocabIndex = 0;
87
+ docFreq.forEach((df, term) => {
88
+ // Add to vocabulary
89
+ this.vocabulary.set(term, vocabIndex++);
90
+ // Calculate IDF
91
+ const idf = Math.log((numDocs - df + 0.5) / (df + 0.5));
92
+ this.idf.set(term, idf);
93
+ });
94
+ this.trained = true;
95
+ console.log(`[SimpleBM25] Learned from ${numDocs} documents`);
96
+ console.log(`[SimpleBM25] Vocabulary size: ${this.vocabulary.size}`);
97
+ console.log(`[SimpleBM25] Average document length: ${this.avgDocLength.toFixed(2)}`);
98
+ }
99
+ /**
100
+ * Generate sparse vector for a single text
101
+ */
102
+ generate(text, config) {
103
+ if (!this.trained) {
104
+ throw new Error('BM25 generator must be trained before generating vectors. Call learn() first.');
105
+ }
106
+ const tokens = this.tokenize(text);
107
+ const termFreq = this.calculateTermFrequency(tokens);
108
+ const docLength = tokens.length;
109
+ const indices = [];
110
+ const values = [];
111
+ // Calculate BM25 score for each term
112
+ termFreq.forEach((tf, term) => {
113
+ const vocabIndex = this.vocabulary.get(term);
114
+ const idfScore = this.idf.get(term);
115
+ // Skip terms not in vocabulary (unknown terms)
116
+ if (vocabIndex === undefined || idfScore === undefined) {
117
+ return;
118
+ }
119
+ // BM25 formula
120
+ const normalizedTF = (tf * (this.k1 + 1)) /
121
+ (tf + this.k1 * (1 - this.b + (this.b * docLength) / this.avgDocLength));
122
+ const score = idfScore * normalizedTF;
123
+ // Apply minimum score threshold if configured
124
+ if (config?.minScore !== undefined && score < config.minScore) {
125
+ return;
126
+ }
127
+ indices.push(vocabIndex);
128
+ values.push(score);
129
+ });
130
+ // Sort by score descending and apply maxTerms limit
131
+ if (config?.maxTerms !== undefined && indices.length > config.maxTerms) {
132
+ const combined = indices.map((idx, i) => ({ idx, val: values[i] }));
133
+ combined.sort((a, b) => b.val - a.val);
134
+ combined.splice(config.maxTerms);
135
+ indices.length = 0;
136
+ values.length = 0;
137
+ combined.forEach(({ idx, val }) => {
138
+ indices.push(idx);
139
+ values.push(val);
140
+ });
141
+ }
142
+ // Normalize if requested
143
+ if (config?.normalize && values.length > 0) {
144
+ const norm = Math.sqrt(values.reduce((sum, val) => sum + val * val, 0));
145
+ for (let i = 0; i < values.length; i++) {
146
+ values[i] /= norm;
147
+ }
148
+ }
149
+ return { indices, values };
150
+ }
151
+ /**
152
+ * Generate sparse vectors for multiple texts (batch operation)
153
+ */
154
+ generateBatch(texts, config) {
155
+ return texts.map(text => this.generate(text, config));
156
+ }
157
+ /**
158
+ * Get vocabulary size
159
+ */
160
+ getVocabularySize() {
161
+ return this.vocabulary.size;
162
+ }
163
+ /**
164
+ * Get average document length
165
+ */
166
+ getAverageDocumentLength() {
167
+ return this.avgDocLength;
168
+ }
169
+ /**
170
+ * Check if trained
171
+ */
172
+ isTrained() {
173
+ return this.trained;
174
+ }
175
+ /**
176
+ * Get the vocabulary (for debugging/inspection)
177
+ */
178
+ getVocabulary() {
179
+ return new Map(this.vocabulary);
180
+ }
181
+ /**
182
+ * Get IDF scores (for debugging/inspection)
183
+ */
184
+ getIDFScores() {
185
+ return new Map(this.idf);
186
+ }
187
+ }
188
+ exports.SimpleBM25 = SimpleBM25;
189
+ //# sourceMappingURL=simple-bm25.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-bm25.js","sourceRoot":"","sources":["../../../src/vectordb/sparse/simple-bm25.ts"],"names":[],"mappings":";;;AAkCA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,UAAU;IAYnB,YAAY,SAAqB,EAAE;QANnC,sBAAsB;QACd,eAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC5C,QAAG,GAAwB,IAAI,GAAG,EAAE,CAAC;QACrC,iBAAY,GAAW,CAAC,CAAC;QACzB,YAAO,GAAY,KAA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parse vectors are used for:
6
+ * - BM25 keyword-based search
7
+ * - Hybrid search (combining dense + sparse)
8
+ * - Text-based retrieval with term importance
9
+ *
10
+ * Implementations should:
11
+ * 1. Learn vocabulary from a corpus
12
+ * 2. Generate sparse vectors with indices (vocabulary positions) and values (scores)
13
+ * 3. Support both single document and batch processing
14
+ */
15
+ export interface SparseVectorGenerator {
16
+ /**
17
+ * Learn vocabulary and statistics from a corpus of documents
18
+ * This should be called during indexing to build IDF statistics
19
+ *
20
+ * @param documents - Array of document texts to learn from
21
+ */
22
+ learn(documents: string[]): void;
23
+ /**
24
+ * Generate sparse vector for a single text
25
+ *
26
+ * @param text - Input text to vectorize
27
+ * @param config - Optional configuration for vector generation
28
+ * @returns Sparse vector with indices and values
29
+ */
30
+ generate(text: string, config?: SparseVectorConfig): SparseVector;
31
+ /**
32
+ * Generate sparse vectors for multiple texts (batch operation)
33
+ *
34
+ * @param texts - Array of input texts to vectorize
35
+ * @param config - Optional configuration for vector generation
36
+ * @returns Array of sparse vectors
37
+ */
38
+ generateBatch(texts: string[], config?: SparseVectorConfig): SparseVector[];
39
+ /**
40
+ * Get the vocabulary size (number of unique terms)
41
+ * Useful for debugging and understanding the sparse vector space
42
+ */
43
+ getVocabularySize(): number;
44
+ /**
45
+ * Get average document length from the learned corpus
46
+ * Used for BM25 length normalization
47
+ */
48
+ getAverageDocumentLength(): number;
49
+ /**
50
+ * Check if the generator has been trained (learned from corpus)
51
+ */
52
+ isTrained(): boolean;
53
+ }
54
+ //# sourceMappingURL=sparse-vector-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sparse-vector-generator.d.ts","sourceRoot":"","sources":["../../../src/vectordb/sparse/sparse-vector-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;;OAKG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEjC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY,CAAC;IAElE;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAAC;IAE5E;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAE5B;;;OAGG;IACH,wBAAwB,IAAI,MAAM,CAAC;IAEnC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sparse-vector-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sparse-vector-generator.js","sourceRoot":"","sources":["../../../src/vectordb/sparse/sparse-vector-generator.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Sparse vector representation
3
+ * Used for BM25 and other sparse encoding methods
4
+ */
5
+ export interface SparseVector {
6
+ /**
7
+ * Indices of non-zero elements
8
+ * Each index maps to a position in the vocabulary
9
+ */
10
+ indices: number[];
11
+ /**
12
+ * Values corresponding to the indices
13
+ * Typically BM25 scores or TF-IDF weights
14
+ */
15
+ values: number[];
16
+ }
17
+ /**
18
+ * Configuration for sparse vector generation
19
+ */
20
+ export interface SparseVectorConfig {
21
+ /**
22
+ * Minimum score threshold for including a term
23
+ * Terms with scores below this will be filtered out
24
+ * @default 0
25
+ */
26
+ minScore?: number;
27
+ /**
28
+ * Maximum number of terms to include in sparse vector
29
+ * @default undefined (no limit)
30
+ */
31
+ maxTerms?: number;
32
+ /**
33
+ * Whether to normalize vector values
34
+ * @default false
35
+ */
36
+ normalize?: boolean;
37
+ }
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vectordb/sparse/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/vectordb/sparse/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,120 @@
1
+ export interface VectorDocument {
2
+ id: string;
3
+ vector: number[];
4
+ content: string;
5
+ relativePath: string;
6
+ startLine: number;
7
+ endLine: number;
8
+ fileExtension: string;
9
+ metadata: Record<string, any>;
10
+ }
11
+ export interface SearchOptions {
12
+ topK?: number;
13
+ filter?: Record<string, any>;
14
+ threshold?: number;
15
+ filterExpr?: string;
16
+ }
17
+ export interface HybridSearchRequest {
18
+ data: number[] | string;
19
+ anns_field: string;
20
+ param: Record<string, any>;
21
+ limit: number;
22
+ }
23
+ export interface HybridSearchOptions {
24
+ rerank?: RerankStrategy;
25
+ limit?: number;
26
+ filterExpr?: string;
27
+ }
28
+ export interface RerankStrategy {
29
+ strategy: 'rrf' | 'weighted';
30
+ params?: Record<string, any>;
31
+ }
32
+ export interface VectorSearchResult {
33
+ document: VectorDocument;
34
+ score: number;
35
+ }
36
+ export interface HybridSearchResult {
37
+ document: VectorDocument;
38
+ score: number;
39
+ }
40
+ export interface VectorDatabase {
41
+ /**
42
+ * Create collection
43
+ * @param collectionName Collection name
44
+ * @param dimension Vector dimension
45
+ * @param description Collection description
46
+ */
47
+ createCollection(collectionName: string, dimension: number, description?: string): Promise<void>;
48
+ /**
49
+ * Create collection with hybrid search support
50
+ * @param collectionName Collection name
51
+ * @param dimension Dense vector dimension
52
+ * @param description Collection description
53
+ */
54
+ createHybridCollection(collectionName: string, dimension: number, description?: string): Promise<void>;
55
+ /**
56
+ * Drop collection
57
+ * @param collectionName Collection name
58
+ */
59
+ dropCollection(collectionName: string): Promise<void>;
60
+ /**
61
+ * Check if collection exists
62
+ * @param collectionName Collection name
63
+ */
64
+ hasCollection(collectionName: string): Promise<boolean>;
65
+ /**
66
+ * List all collections
67
+ */
68
+ listCollections(): Promise<string[]>;
69
+ /**
70
+ * Insert vector documents
71
+ * @param collectionName Collection name
72
+ * @param documents Document array
73
+ */
74
+ insert(collectionName: string, documents: VectorDocument[]): Promise<void>;
75
+ /**
76
+ * Insert hybrid vector documents
77
+ * @param collectionName Collection name
78
+ * @param documents Document array
79
+ */
80
+ insertHybrid(collectionName: string, documents: VectorDocument[]): Promise<void>;
81
+ /**
82
+ * Search similar vectors
83
+ * @param collectionName Collection name
84
+ * @param queryVector Query vector
85
+ * @param options Search options
86
+ */
87
+ search(collectionName: string, queryVector: number[], options?: SearchOptions): Promise<VectorSearchResult[]>;
88
+ /**
89
+ * Hybrid search with multiple vector fields
90
+ * @param collectionName Collection name
91
+ * @param searchRequests Array of search requests for different fields
92
+ * @param options Hybrid search options including reranking
93
+ */
94
+ hybridSearch(collectionName: string, searchRequests: HybridSearchRequest[], options?: HybridSearchOptions): Promise<HybridSearchResult[]>;
95
+ /**
96
+ * Delete documents
97
+ * @param collectionName Collection name
98
+ * @param ids Document ID array
99
+ */
100
+ delete(collectionName: string, ids: string[]): Promise<void>;
101
+ /**
102
+ * Query documents with filter conditions
103
+ * @param collectionName Collection name
104
+ * @param filter Filter expression
105
+ * @param outputFields Fields to return
106
+ * @param limit Maximum number of results
107
+ */
108
+ query(collectionName: string, filter: string, outputFields: string[], limit?: number): Promise<Record<string, any>[]>;
109
+ /**
110
+ * Check collection limit
111
+ * Returns true if collection can be created, false if limit exceeded
112
+ */
113
+ checkCollectionLimit(): Promise<boolean>;
114
+ }
115
+ /**
116
+ * Special error message for collection limit exceeded
117
+ * This allows us to distinguish it from other errors across all Milvus implementations
118
+ */
119
+ export declare const COLLECTION_LIMIT_MESSAGE = "[Error]: Your Zilliz Cloud account has hit its collection limit. To continue creating collections, you'll need to expand your capacity. We recommend visiting https://zilliz.com/pricing to explore options for dedicated or serverless clusters.";
120
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/vectordb/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,EAAE,cAAc,CAA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AAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAE9G;;;;;OAKG;IACH,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAE1I;;;;OAIG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;;;;OAMG;IACH,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;IAEtH;;;OAGG;IACH,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,sPAAsP,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COLLECTION_LIMIT_MESSAGE = void 0;
4
+ /**
5
+ * Special error message for collection limit exceeded
6
+ * This allows us to distinguish it from other errors across all Milvus implementations
7
+ */
8
+ exports.COLLECTION_LIMIT_MESSAGE = "[Error]: Your Zilliz Cloud account has hit its collection limit. To continue creating collections, you'll need to expand your capacity. We recommend visiting https://zilliz.com/pricing to explore options for dedicated or serverless clusters.";
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/vectordb/types.ts"],"names":[],"mappings":";;;AAuIA;;;GAGG;AACU,QAAA,wBAAwB,GAAG,mPAAmP,CAAC"}