praisonai 1.2.1 → 1.2.2

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 (45) hide show
  1. package/dist/cache/index.d.ts +78 -0
  2. package/dist/cache/index.js +235 -0
  3. package/dist/db/postgres.d.ts +84 -0
  4. package/dist/db/postgres.js +266 -0
  5. package/dist/db/redis.d.ts +109 -0
  6. package/dist/db/redis.js +307 -0
  7. package/dist/db/sqlite.d.ts +66 -0
  8. package/dist/db/sqlite.js +339 -0
  9. package/dist/events/index.d.ts +84 -0
  10. package/dist/events/index.js +153 -0
  11. package/dist/index.d.ts +11 -0
  12. package/dist/index.js +84 -1
  13. package/dist/integrations/index.d.ts +7 -0
  14. package/dist/integrations/index.js +26 -0
  15. package/dist/integrations/observability/base.d.ts +123 -0
  16. package/dist/integrations/observability/base.js +183 -0
  17. package/dist/integrations/observability/index.d.ts +8 -0
  18. package/dist/integrations/observability/index.js +29 -0
  19. package/dist/integrations/observability/langfuse.d.ts +32 -0
  20. package/dist/integrations/observability/langfuse.js +174 -0
  21. package/dist/integrations/vector/base.d.ts +110 -0
  22. package/dist/integrations/vector/base.js +158 -0
  23. package/dist/integrations/vector/chroma.d.ts +25 -0
  24. package/dist/integrations/vector/chroma.js +143 -0
  25. package/dist/integrations/vector/index.d.ts +14 -0
  26. package/dist/integrations/vector/index.js +37 -0
  27. package/dist/integrations/vector/pinecone.d.ts +28 -0
  28. package/dist/integrations/vector/pinecone.js +172 -0
  29. package/dist/integrations/vector/qdrant.d.ts +25 -0
  30. package/dist/integrations/vector/qdrant.js +146 -0
  31. package/dist/integrations/vector/weaviate.d.ts +30 -0
  32. package/dist/integrations/vector/weaviate.js +206 -0
  33. package/dist/integrations/voice/base.d.ts +76 -0
  34. package/dist/integrations/voice/base.js +168 -0
  35. package/dist/integrations/voice/index.d.ts +6 -0
  36. package/dist/integrations/voice/index.js +26 -0
  37. package/dist/knowledge/graph-rag.d.ts +125 -0
  38. package/dist/knowledge/graph-rag.js +289 -0
  39. package/dist/knowledge/index.d.ts +2 -0
  40. package/dist/knowledge/index.js +18 -0
  41. package/dist/knowledge/reranker.d.ts +86 -0
  42. package/dist/knowledge/reranker.js +196 -0
  43. package/dist/workflows/yaml-parser.d.ts +48 -0
  44. package/dist/workflows/yaml-parser.js +304 -0
  45. package/package.json +1 -1
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ /**
3
+ * Langfuse Observability Integration
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LangfuseObservabilityProvider = void 0;
7
+ exports.createLangfuseObservability = createLangfuseObservability;
8
+ const base_1 = require("./base");
9
+ class LangfuseObservabilityProvider extends base_1.BaseObservabilityProvider {
10
+ constructor(config) {
11
+ super('LangfuseObservability');
12
+ this.queue = [];
13
+ this.publicKey = config.publicKey;
14
+ this.secretKey = config.secretKey;
15
+ this.baseUrl = config.baseUrl || 'https://cloud.langfuse.com';
16
+ this.flushAt = config.flushAt || 20;
17
+ this.flushInterval = config.flushInterval || 10000;
18
+ this.startFlushTimer();
19
+ }
20
+ startFlushTimer() {
21
+ this.flushTimer = setInterval(() => {
22
+ if (this.queue.length > 0) {
23
+ this.flush();
24
+ }
25
+ }, this.flushInterval);
26
+ }
27
+ async request(path, body) {
28
+ const auth = Buffer.from(`${this.publicKey}:${this.secretKey}`).toString('base64');
29
+ const response = await fetch(`${this.baseUrl}${path}`, {
30
+ method: 'POST',
31
+ headers: {
32
+ 'Authorization': `Basic ${auth}`,
33
+ 'Content-Type': 'application/json'
34
+ },
35
+ body: JSON.stringify(body)
36
+ });
37
+ if (!response.ok) {
38
+ const error = await response.text();
39
+ throw new Error(`Langfuse API error: ${response.status} - ${error}`);
40
+ }
41
+ return response.json();
42
+ }
43
+ enqueue(event) {
44
+ this.queue.push(event);
45
+ if (this.queue.length >= this.flushAt) {
46
+ this.flush();
47
+ }
48
+ }
49
+ startSpan(name, attributes, parentContext) {
50
+ const span = {
51
+ id: this.generateId(),
52
+ traceId: parentContext?.traceId || this.generateId(),
53
+ parentId: parentContext?.spanId,
54
+ name,
55
+ startTime: Date.now(),
56
+ status: 'unset',
57
+ attributes: attributes || {},
58
+ events: []
59
+ };
60
+ // Create trace if this is root span
61
+ if (!parentContext) {
62
+ this.enqueue({
63
+ type: 'trace-create',
64
+ body: {
65
+ id: span.traceId,
66
+ name,
67
+ metadata: attributes,
68
+ timestamp: new Date(span.startTime).toISOString()
69
+ }
70
+ });
71
+ }
72
+ // Create span/generation
73
+ this.enqueue({
74
+ type: 'span-create',
75
+ body: {
76
+ id: span.id,
77
+ traceId: span.traceId,
78
+ parentObservationId: span.parentId,
79
+ name,
80
+ startTime: new Date(span.startTime).toISOString(),
81
+ metadata: attributes
82
+ }
83
+ });
84
+ return span;
85
+ }
86
+ endSpan(span, status = 'ok', error) {
87
+ span.endTime = Date.now();
88
+ span.status = status;
89
+ const updateBody = {
90
+ spanId: span.id,
91
+ endTime: new Date(span.endTime).toISOString(),
92
+ level: status === 'error' ? 'ERROR' : 'DEFAULT'
93
+ };
94
+ if (error) {
95
+ updateBody.statusMessage = error.message;
96
+ }
97
+ this.enqueue({
98
+ type: 'span-update',
99
+ body: updateBody
100
+ });
101
+ }
102
+ addSpanEvent(span, name, attributes) {
103
+ span.events.push({
104
+ name,
105
+ timestamp: Date.now(),
106
+ attributes
107
+ });
108
+ this.enqueue({
109
+ type: 'event-create',
110
+ body: {
111
+ traceId: span.traceId,
112
+ observationId: span.id,
113
+ name,
114
+ metadata: attributes,
115
+ timestamp: new Date().toISOString()
116
+ }
117
+ });
118
+ }
119
+ log(entry) {
120
+ // Langfuse doesn't have direct log support, use events instead
121
+ if (entry.traceId) {
122
+ this.enqueue({
123
+ type: 'event-create',
124
+ body: {
125
+ traceId: entry.traceId,
126
+ observationId: entry.spanId,
127
+ name: `log:${entry.level}`,
128
+ metadata: {
129
+ message: entry.message,
130
+ ...entry.attributes
131
+ },
132
+ timestamp: new Date(entry.timestamp).toISOString()
133
+ }
134
+ });
135
+ }
136
+ }
137
+ recordMetric(metric) {
138
+ // Langfuse uses scores for metrics
139
+ this.enqueue({
140
+ type: 'score-create',
141
+ body: {
142
+ name: metric.name,
143
+ value: metric.value,
144
+ timestamp: new Date(metric.timestamp).toISOString(),
145
+ comment: JSON.stringify(metric.tags)
146
+ }
147
+ });
148
+ }
149
+ async flush() {
150
+ if (this.queue.length === 0)
151
+ return;
152
+ const batch = this.queue.splice(0, this.queue.length);
153
+ try {
154
+ await this.request('/api/public/ingestion', {
155
+ batch
156
+ });
157
+ }
158
+ catch (error) {
159
+ // Re-add failed items to queue
160
+ this.queue.unshift(...batch);
161
+ console.error('Langfuse flush error:', error);
162
+ }
163
+ }
164
+ async shutdown() {
165
+ if (this.flushTimer) {
166
+ clearInterval(this.flushTimer);
167
+ }
168
+ await this.flush();
169
+ }
170
+ }
171
+ exports.LangfuseObservabilityProvider = LangfuseObservabilityProvider;
172
+ function createLangfuseObservability(config) {
173
+ return new LangfuseObservabilityProvider(config);
174
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Base Vector Store - Abstract class for vector database integrations
3
+ * Matches mastra's MastraVector pattern
4
+ */
5
+ export interface VectorDocument {
6
+ id: string;
7
+ vector: number[];
8
+ metadata?: Record<string, any>;
9
+ content?: string;
10
+ }
11
+ export interface QueryResult {
12
+ id: string;
13
+ score: number;
14
+ metadata?: Record<string, any>;
15
+ content?: string;
16
+ vector?: number[];
17
+ }
18
+ export interface IndexStats {
19
+ dimension: number;
20
+ count: number;
21
+ metric: 'cosine' | 'euclidean' | 'dotProduct';
22
+ }
23
+ export interface CreateIndexParams {
24
+ indexName: string;
25
+ dimension: number;
26
+ metric?: 'cosine' | 'euclidean' | 'dotProduct';
27
+ }
28
+ export interface UpsertParams {
29
+ indexName: string;
30
+ vectors: VectorDocument[];
31
+ }
32
+ export interface QueryParams {
33
+ indexName: string;
34
+ vector: number[];
35
+ topK?: number;
36
+ filter?: Record<string, any>;
37
+ includeMetadata?: boolean;
38
+ includeVectors?: boolean;
39
+ }
40
+ export interface DeleteParams {
41
+ indexName: string;
42
+ ids?: string[];
43
+ filter?: Record<string, any>;
44
+ }
45
+ /**
46
+ * Abstract base class for vector store implementations
47
+ */
48
+ export declare abstract class BaseVectorStore {
49
+ readonly id: string;
50
+ readonly name: string;
51
+ constructor(config: {
52
+ id: string;
53
+ name?: string;
54
+ });
55
+ /**
56
+ * Create a new index
57
+ */
58
+ abstract createIndex(params: CreateIndexParams): Promise<void>;
59
+ /**
60
+ * List all indexes
61
+ */
62
+ abstract listIndexes(): Promise<string[]>;
63
+ /**
64
+ * Get index statistics
65
+ */
66
+ abstract describeIndex(indexName: string): Promise<IndexStats>;
67
+ /**
68
+ * Delete an index
69
+ */
70
+ abstract deleteIndex(indexName: string): Promise<void>;
71
+ /**
72
+ * Upsert vectors into an index
73
+ */
74
+ abstract upsert(params: UpsertParams): Promise<string[]>;
75
+ /**
76
+ * Query vectors by similarity
77
+ */
78
+ abstract query(params: QueryParams): Promise<QueryResult[]>;
79
+ /**
80
+ * Delete vectors by ID or filter
81
+ */
82
+ abstract delete(params: DeleteParams): Promise<void>;
83
+ /**
84
+ * Update vector metadata
85
+ */
86
+ abstract update(indexName: string, id: string, metadata: Record<string, any>): Promise<void>;
87
+ }
88
+ /**
89
+ * In-memory vector store for testing and development
90
+ */
91
+ export declare class MemoryVectorStore extends BaseVectorStore {
92
+ private indexes;
93
+ constructor(config?: {
94
+ id: string;
95
+ });
96
+ createIndex(params: CreateIndexParams): Promise<void>;
97
+ listIndexes(): Promise<string[]>;
98
+ describeIndex(indexName: string): Promise<IndexStats>;
99
+ deleteIndex(indexName: string): Promise<void>;
100
+ upsert(params: UpsertParams): Promise<string[]>;
101
+ query(params: QueryParams): Promise<QueryResult[]>;
102
+ delete(params: DeleteParams): Promise<void>;
103
+ update(indexName: string, id: string, metadata: Record<string, any>): Promise<void>;
104
+ private calculateSimilarity;
105
+ private cosineSimilarity;
106
+ private euclideanDistance;
107
+ private dotProduct;
108
+ private matchesFilter;
109
+ }
110
+ export declare function createMemoryVectorStore(id?: string): MemoryVectorStore;
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ /**
3
+ * Base Vector Store - Abstract class for vector database integrations
4
+ * Matches mastra's MastraVector pattern
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.MemoryVectorStore = exports.BaseVectorStore = void 0;
8
+ exports.createMemoryVectorStore = createMemoryVectorStore;
9
+ /**
10
+ * Abstract base class for vector store implementations
11
+ */
12
+ class BaseVectorStore {
13
+ constructor(config) {
14
+ this.id = config.id;
15
+ this.name = config.name || 'VectorStore';
16
+ }
17
+ }
18
+ exports.BaseVectorStore = BaseVectorStore;
19
+ /**
20
+ * In-memory vector store for testing and development
21
+ */
22
+ class MemoryVectorStore extends BaseVectorStore {
23
+ constructor(config = { id: 'memory' }) {
24
+ super({ ...config, name: 'MemoryVectorStore' });
25
+ this.indexes = new Map();
26
+ }
27
+ async createIndex(params) {
28
+ if (this.indexes.has(params.indexName)) {
29
+ return; // Index already exists
30
+ }
31
+ this.indexes.set(params.indexName, {
32
+ dimension: params.dimension,
33
+ metric: params.metric || 'cosine',
34
+ vectors: new Map()
35
+ });
36
+ }
37
+ async listIndexes() {
38
+ return Array.from(this.indexes.keys());
39
+ }
40
+ async describeIndex(indexName) {
41
+ const index = this.indexes.get(indexName);
42
+ if (!index) {
43
+ throw new Error(`Index ${indexName} not found`);
44
+ }
45
+ return {
46
+ dimension: index.dimension,
47
+ count: index.vectors.size,
48
+ metric: index.metric
49
+ };
50
+ }
51
+ async deleteIndex(indexName) {
52
+ this.indexes.delete(indexName);
53
+ }
54
+ async upsert(params) {
55
+ const index = this.indexes.get(params.indexName);
56
+ if (!index) {
57
+ throw new Error(`Index ${params.indexName} not found`);
58
+ }
59
+ const ids = [];
60
+ for (const doc of params.vectors) {
61
+ index.vectors.set(doc.id, doc);
62
+ ids.push(doc.id);
63
+ }
64
+ return ids;
65
+ }
66
+ async query(params) {
67
+ const index = this.indexes.get(params.indexName);
68
+ if (!index) {
69
+ throw new Error(`Index ${params.indexName} not found`);
70
+ }
71
+ const results = [];
72
+ for (const [id, doc] of index.vectors) {
73
+ // Apply filter if provided
74
+ if (params.filter && !this.matchesFilter(doc.metadata || {}, params.filter)) {
75
+ continue;
76
+ }
77
+ const score = this.calculateSimilarity(params.vector, doc.vector, index.metric);
78
+ results.push({
79
+ id,
80
+ score,
81
+ metadata: params.includeMetadata ? doc.metadata : undefined,
82
+ content: doc.content,
83
+ vector: params.includeVectors ? doc.vector : undefined
84
+ });
85
+ }
86
+ // Sort by score descending and limit
87
+ results.sort((a, b) => b.score - a.score);
88
+ return results.slice(0, params.topK || 10);
89
+ }
90
+ async delete(params) {
91
+ const index = this.indexes.get(params.indexName);
92
+ if (!index) {
93
+ throw new Error(`Index ${params.indexName} not found`);
94
+ }
95
+ if (params.ids) {
96
+ for (const id of params.ids) {
97
+ index.vectors.delete(id);
98
+ }
99
+ }
100
+ else if (params.filter) {
101
+ for (const [id, doc] of index.vectors) {
102
+ if (this.matchesFilter(doc.metadata || {}, params.filter)) {
103
+ index.vectors.delete(id);
104
+ }
105
+ }
106
+ }
107
+ }
108
+ async update(indexName, id, metadata) {
109
+ const index = this.indexes.get(indexName);
110
+ if (!index) {
111
+ throw new Error(`Index ${indexName} not found`);
112
+ }
113
+ const doc = index.vectors.get(id);
114
+ if (doc) {
115
+ doc.metadata = { ...doc.metadata, ...metadata };
116
+ }
117
+ }
118
+ calculateSimilarity(a, b, metric) {
119
+ if (a.length !== b.length) {
120
+ throw new Error('Vector dimensions must match');
121
+ }
122
+ switch (metric) {
123
+ case 'cosine':
124
+ return this.cosineSimilarity(a, b);
125
+ case 'euclidean':
126
+ return 1 / (1 + this.euclideanDistance(a, b));
127
+ case 'dotProduct':
128
+ return this.dotProduct(a, b);
129
+ default:
130
+ return this.cosineSimilarity(a, b);
131
+ }
132
+ }
133
+ cosineSimilarity(a, b) {
134
+ const dot = this.dotProduct(a, b);
135
+ const normA = Math.sqrt(a.reduce((sum, x) => sum + x * x, 0));
136
+ const normB = Math.sqrt(b.reduce((sum, x) => sum + x * x, 0));
137
+ return dot / (normA * normB);
138
+ }
139
+ euclideanDistance(a, b) {
140
+ return Math.sqrt(a.reduce((sum, x, i) => sum + Math.pow(x - b[i], 2), 0));
141
+ }
142
+ dotProduct(a, b) {
143
+ return a.reduce((sum, x, i) => sum + x * b[i], 0);
144
+ }
145
+ matchesFilter(metadata, filter) {
146
+ for (const [key, value] of Object.entries(filter)) {
147
+ if (metadata[key] !== value) {
148
+ return false;
149
+ }
150
+ }
151
+ return true;
152
+ }
153
+ }
154
+ exports.MemoryVectorStore = MemoryVectorStore;
155
+ // Factory function
156
+ function createMemoryVectorStore(id) {
157
+ return new MemoryVectorStore({ id: id || 'memory' });
158
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Chroma Vector Store Integration
3
+ */
4
+ import { BaseVectorStore, CreateIndexParams, UpsertParams, QueryParams, DeleteParams, QueryResult, IndexStats } from './base';
5
+ export interface ChromaConfig {
6
+ host?: string;
7
+ port?: number;
8
+ path?: string;
9
+ }
10
+ export declare class ChromaVectorStore extends BaseVectorStore {
11
+ private baseUrl;
12
+ constructor(config?: ChromaConfig & {
13
+ id?: string;
14
+ });
15
+ private request;
16
+ createIndex(params: CreateIndexParams): Promise<void>;
17
+ listIndexes(): Promise<string[]>;
18
+ describeIndex(indexName: string): Promise<IndexStats>;
19
+ deleteIndex(indexName: string): Promise<void>;
20
+ upsert(params: UpsertParams): Promise<string[]>;
21
+ query(params: QueryParams): Promise<QueryResult[]>;
22
+ delete(params: DeleteParams): Promise<void>;
23
+ update(indexName: string, id: string, metadata: Record<string, any>): Promise<void>;
24
+ }
25
+ export declare function createChromaStore(config?: ChromaConfig): ChromaVectorStore;
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ /**
3
+ * Chroma Vector Store Integration
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ChromaVectorStore = void 0;
7
+ exports.createChromaStore = createChromaStore;
8
+ const base_1 = require("./base");
9
+ class ChromaVectorStore extends base_1.BaseVectorStore {
10
+ constructor(config = {}) {
11
+ super({ id: config.id || 'chroma', name: 'ChromaVectorStore' });
12
+ const host = config.host || 'localhost';
13
+ const port = config.port || 8000;
14
+ this.baseUrl = config.path || `http://${host}:${port}`;
15
+ }
16
+ async request(path, options = {}) {
17
+ const response = await fetch(`${this.baseUrl}${path}`, {
18
+ ...options,
19
+ headers: {
20
+ 'Content-Type': 'application/json',
21
+ ...options.headers
22
+ }
23
+ });
24
+ if (!response.ok) {
25
+ const error = await response.text();
26
+ throw new Error(`Chroma API error: ${response.status} - ${error}`);
27
+ }
28
+ const text = await response.text();
29
+ return text ? JSON.parse(text) : {};
30
+ }
31
+ async createIndex(params) {
32
+ const metadataMap = {
33
+ cosine: 'cosine',
34
+ euclidean: 'l2',
35
+ dotProduct: 'ip'
36
+ };
37
+ await this.request('/api/v1/collections', {
38
+ method: 'POST',
39
+ body: JSON.stringify({
40
+ name: params.indexName,
41
+ metadata: {
42
+ 'hnsw:space': metadataMap[params.metric || 'cosine'],
43
+ dimension: params.dimension
44
+ }
45
+ })
46
+ });
47
+ }
48
+ async listIndexes() {
49
+ const response = await this.request('/api/v1/collections');
50
+ return (response || []).map((c) => c.name);
51
+ }
52
+ async describeIndex(indexName) {
53
+ const response = await this.request(`/api/v1/collections/${indexName}`);
54
+ const spaceMap = {
55
+ 'cosine': 'cosine',
56
+ 'l2': 'euclidean',
57
+ 'ip': 'dotProduct'
58
+ };
59
+ return {
60
+ dimension: response.metadata?.dimension || 0,
61
+ count: response.count || 0,
62
+ metric: spaceMap[response.metadata?.['hnsw:space']] || 'cosine'
63
+ };
64
+ }
65
+ async deleteIndex(indexName) {
66
+ await this.request(`/api/v1/collections/${indexName}`, { method: 'DELETE' });
67
+ }
68
+ async upsert(params) {
69
+ const ids = params.vectors.map(v => v.id);
70
+ const embeddings = params.vectors.map(v => v.vector);
71
+ const metadatas = params.vectors.map(v => v.metadata || {});
72
+ const documents = params.vectors.map(v => v.content || '');
73
+ await this.request(`/api/v1/collections/${params.indexName}/upsert`, {
74
+ method: 'POST',
75
+ body: JSON.stringify({
76
+ ids,
77
+ embeddings,
78
+ metadatas,
79
+ documents
80
+ })
81
+ });
82
+ return ids;
83
+ }
84
+ async query(params) {
85
+ let where = undefined;
86
+ if (params.filter) {
87
+ where = params.filter;
88
+ }
89
+ const response = await this.request(`/api/v1/collections/${params.indexName}/query`, {
90
+ method: 'POST',
91
+ body: JSON.stringify({
92
+ query_embeddings: [params.vector],
93
+ n_results: params.topK || 10,
94
+ where,
95
+ include: [
96
+ 'documents',
97
+ 'metadatas',
98
+ 'distances',
99
+ ...(params.includeVectors ? ['embeddings'] : [])
100
+ ]
101
+ })
102
+ });
103
+ const ids = response.ids?.[0] || [];
104
+ const distances = response.distances?.[0] || [];
105
+ const metadatas = response.metadatas?.[0] || [];
106
+ const documents = response.documents?.[0] || [];
107
+ const embeddings = response.embeddings?.[0] || [];
108
+ return ids.map((id, i) => ({
109
+ id,
110
+ score: 1 - (distances[i] || 0), // Convert distance to similarity
111
+ metadata: metadatas[i],
112
+ content: documents[i],
113
+ vector: embeddings[i]
114
+ }));
115
+ }
116
+ async delete(params) {
117
+ if (params.ids) {
118
+ await this.request(`/api/v1/collections/${params.indexName}/delete`, {
119
+ method: 'POST',
120
+ body: JSON.stringify({ ids: params.ids })
121
+ });
122
+ }
123
+ else if (params.filter) {
124
+ await this.request(`/api/v1/collections/${params.indexName}/delete`, {
125
+ method: 'POST',
126
+ body: JSON.stringify({ where: params.filter })
127
+ });
128
+ }
129
+ }
130
+ async update(indexName, id, metadata) {
131
+ await this.request(`/api/v1/collections/${indexName}/update`, {
132
+ method: 'POST',
133
+ body: JSON.stringify({
134
+ ids: [id],
135
+ metadatas: [metadata]
136
+ })
137
+ });
138
+ }
139
+ }
140
+ exports.ChromaVectorStore = ChromaVectorStore;
141
+ function createChromaStore(config) {
142
+ return new ChromaVectorStore(config);
143
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Vector Store Integrations
3
+ * Provides adapters for various vector databases
4
+ */
5
+ export * from './base';
6
+ export * from './pinecone';
7
+ export * from './weaviate';
8
+ export * from './qdrant';
9
+ export * from './chroma';
10
+ export { createMemoryVectorStore } from './base';
11
+ export { createPineconeStore } from './pinecone';
12
+ export { createWeaviateStore } from './weaviate';
13
+ export { createQdrantStore } from './qdrant';
14
+ export { createChromaStore } from './chroma';
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Vector Store Integrations
4
+ * Provides adapters for various vector databases
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.createChromaStore = exports.createQdrantStore = exports.createWeaviateStore = exports.createPineconeStore = exports.createMemoryVectorStore = void 0;
22
+ __exportStar(require("./base"), exports);
23
+ __exportStar(require("./pinecone"), exports);
24
+ __exportStar(require("./weaviate"), exports);
25
+ __exportStar(require("./qdrant"), exports);
26
+ __exportStar(require("./chroma"), exports);
27
+ // Re-export factory functions for convenience
28
+ var base_1 = require("./base");
29
+ Object.defineProperty(exports, "createMemoryVectorStore", { enumerable: true, get: function () { return base_1.createMemoryVectorStore; } });
30
+ var pinecone_1 = require("./pinecone");
31
+ Object.defineProperty(exports, "createPineconeStore", { enumerable: true, get: function () { return pinecone_1.createPineconeStore; } });
32
+ var weaviate_1 = require("./weaviate");
33
+ Object.defineProperty(exports, "createWeaviateStore", { enumerable: true, get: function () { return weaviate_1.createWeaviateStore; } });
34
+ var qdrant_1 = require("./qdrant");
35
+ Object.defineProperty(exports, "createQdrantStore", { enumerable: true, get: function () { return qdrant_1.createQdrantStore; } });
36
+ var chroma_1 = require("./chroma");
37
+ Object.defineProperty(exports, "createChromaStore", { enumerable: true, get: function () { return chroma_1.createChromaStore; } });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Pinecone Vector Store Integration
3
+ */
4
+ import { BaseVectorStore, CreateIndexParams, UpsertParams, QueryParams, DeleteParams, QueryResult, IndexStats } from './base';
5
+ export interface PineconeConfig {
6
+ apiKey: string;
7
+ environment?: string;
8
+ projectId?: string;
9
+ }
10
+ export declare class PineconeVectorStore extends BaseVectorStore {
11
+ private apiKey;
12
+ private baseUrl;
13
+ private indexHosts;
14
+ constructor(config: PineconeConfig & {
15
+ id?: string;
16
+ });
17
+ private request;
18
+ private indexRequest;
19
+ createIndex(params: CreateIndexParams): Promise<void>;
20
+ listIndexes(): Promise<string[]>;
21
+ describeIndex(indexName: string): Promise<IndexStats>;
22
+ deleteIndex(indexName: string): Promise<void>;
23
+ upsert(params: UpsertParams): Promise<string[]>;
24
+ query(params: QueryParams): Promise<QueryResult[]>;
25
+ delete(params: DeleteParams): Promise<void>;
26
+ update(indexName: string, id: string, metadata: Record<string, any>): Promise<void>;
27
+ }
28
+ export declare function createPineconeStore(config: PineconeConfig): PineconeVectorStore;