@juspay/neurolink 9.88.12 → 9.90.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.
- package/CHANGELOG.md +16 -0
- package/README.md +4 -3
- package/dist/adapters/tts/googleTTSHandler.d.ts +10 -0
- package/dist/adapters/tts/googleTTSHandler.js +27 -18
- package/dist/agent/directTools.js +1 -1
- package/dist/browser/neurolink.min.js +370 -356
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/adapters/tts/googleTTSHandler.d.ts +10 -0
- package/dist/lib/adapters/tts/googleTTSHandler.js +27 -18
- package/dist/lib/agent/directTools.js +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/neurolink.js +1 -1
- package/dist/lib/rag/index.d.ts +1 -0
- package/dist/lib/rag/index.js +2 -0
- package/dist/lib/rag/stores/chroma.d.ts +90 -0
- package/dist/lib/rag/stores/chroma.js +281 -0
- package/dist/lib/rag/stores/index.d.ts +21 -0
- package/dist/lib/rag/stores/index.js +22 -0
- package/dist/lib/rag/stores/pgvector.d.ts +95 -0
- package/dist/lib/rag/stores/pgvector.js +400 -0
- package/dist/lib/rag/stores/pinecone.d.ts +85 -0
- package/dist/lib/rag/stores/pinecone.js +159 -0
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/index.js +2 -0
- package/dist/lib/types/rag.d.ts +30 -0
- package/dist/lib/types/vectorStoreChroma.d.ts +67 -0
- package/dist/lib/types/vectorStoreChroma.js +12 -0
- package/dist/lib/types/vectorStorePinecone.d.ts +48 -0
- package/dist/lib/types/vectorStorePinecone.js +12 -0
- package/dist/neurolink.js +1 -1
- package/dist/rag/index.d.ts +1 -0
- package/dist/rag/index.js +2 -0
- package/dist/rag/stores/chroma.d.ts +90 -0
- package/dist/rag/stores/chroma.js +280 -0
- package/dist/rag/stores/index.d.ts +21 -0
- package/dist/rag/stores/index.js +21 -0
- package/dist/rag/stores/pgvector.d.ts +95 -0
- package/dist/rag/stores/pgvector.js +399 -0
- package/dist/rag/stores/pinecone.d.ts +85 -0
- package/dist/rag/stores/pinecone.js +158 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/rag.d.ts +30 -0
- package/dist/types/vectorStoreChroma.d.ts +67 -0
- package/dist/types/vectorStoreChroma.js +11 -0
- package/dist/types/vectorStorePinecone.d.ts +48 -0
- package/dist/types/vectorStorePinecone.js +11 -0
- package/package.json +12 -8
package/dist/types/rag.d.ts
CHANGED
|
@@ -419,6 +419,36 @@ export type VectorStore = {
|
|
|
419
419
|
includeVectors?: boolean;
|
|
420
420
|
}): Promise<VectorQueryResult[]>;
|
|
421
421
|
};
|
|
422
|
+
/** Minimal shape of a query result, satisfied by both `pg` and `pglite`. */
|
|
423
|
+
export type PgQueryResult<T = unknown> = {
|
|
424
|
+
rows: T[];
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Minimal structural interface a caller-supplied Postgres client must
|
|
428
|
+
* satisfy. Both `pg.Pool` (`node-postgres`) and `@electric-sql/pglite`
|
|
429
|
+
* instances already expose a compatible `query(text, values?)` method —
|
|
430
|
+
* neither is a dependency of this package. Callers construct and own the
|
|
431
|
+
* client; `PgVectorStore` only ever calls `query()` on it.
|
|
432
|
+
*/
|
|
433
|
+
export type PgClientLike = {
|
|
434
|
+
query(text: string, values?: unknown[]): Promise<PgQueryResult>;
|
|
435
|
+
};
|
|
436
|
+
/** Construction options for `PgVectorStore`. */
|
|
437
|
+
export type PgVectorStoreOptions = {
|
|
438
|
+
/**
|
|
439
|
+
* Prefix prepended to `indexName` to derive the backing table name.
|
|
440
|
+
* Must itself be a valid, unquoted Postgres identifier.
|
|
441
|
+
* @default "neurolink_vs_"
|
|
442
|
+
*/
|
|
443
|
+
tablePrefix?: string;
|
|
444
|
+
};
|
|
445
|
+
/** Row shape returned by `PgVectorStore`'s SELECT queries. */
|
|
446
|
+
export type PgVectorStoreRow = {
|
|
447
|
+
id: string;
|
|
448
|
+
metadata: unknown;
|
|
449
|
+
score: unknown;
|
|
450
|
+
embedding?: unknown;
|
|
451
|
+
};
|
|
422
452
|
/**
|
|
423
453
|
* Document loader options
|
|
424
454
|
*/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural types for the Chroma vector store adapter
|
|
3
|
+
* (`src/lib/rag/stores/chroma.ts`).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the subset of the `chromadb` package's API the adapter
|
|
6
|
+
* calls (`ChromaClient.getOrCreateCollection`, `Collection.upsert/query/
|
|
7
|
+
* delete`). NeuroLink has zero runtime dependency on `chromadb` — callers
|
|
8
|
+
* construct their own client and inject an object satisfying
|
|
9
|
+
* `ChromaClientLike`.
|
|
10
|
+
*/
|
|
11
|
+
export type ChromaMetadataValue = string | number | boolean;
|
|
12
|
+
export type ChromaMetadata = Record<string, ChromaMetadataValue>;
|
|
13
|
+
/** Chroma's metadata `where` filter payload shape. */
|
|
14
|
+
export type ChromaWhere = Record<string, unknown>;
|
|
15
|
+
export type ChromaIncludeField = "embeddings" | "metadatas" | "documents" | "distances";
|
|
16
|
+
export type ChromaUpsertParams = {
|
|
17
|
+
ids: string[];
|
|
18
|
+
embeddings?: number[][];
|
|
19
|
+
metadatas?: Array<ChromaMetadata | null>;
|
|
20
|
+
documents?: Array<string | null>;
|
|
21
|
+
};
|
|
22
|
+
export type ChromaQueryParams = {
|
|
23
|
+
queryEmbeddings: number[][];
|
|
24
|
+
nResults?: number;
|
|
25
|
+
where?: ChromaWhere;
|
|
26
|
+
include?: ChromaIncludeField[];
|
|
27
|
+
};
|
|
28
|
+
export type ChromaQueryResponse = {
|
|
29
|
+
ids: string[][];
|
|
30
|
+
embeddings?: Array<Array<number[] | null>> | null;
|
|
31
|
+
metadatas?: Array<Array<ChromaMetadata | null>> | null;
|
|
32
|
+
documents?: Array<Array<string | null>> | null;
|
|
33
|
+
distances?: Array<Array<number | null>> | null;
|
|
34
|
+
};
|
|
35
|
+
export type ChromaDeleteParams = {
|
|
36
|
+
ids?: string[];
|
|
37
|
+
where?: ChromaWhere;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Minimal structural interface for a Chroma collection handle, matching the
|
|
41
|
+
* subset of `Collection` (from `chromadb`) the adapter calls.
|
|
42
|
+
*/
|
|
43
|
+
export type ChromaCollectionLike = {
|
|
44
|
+
upsert(params: ChromaUpsertParams): Promise<unknown>;
|
|
45
|
+
query(params: ChromaQueryParams): Promise<ChromaQueryResponse>;
|
|
46
|
+
delete(params: ChromaDeleteParams): Promise<unknown>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Minimal structural interface for a Chroma client, matching the subset of
|
|
50
|
+
* `ChromaClient` (from `chromadb`) the adapter calls.
|
|
51
|
+
*/
|
|
52
|
+
export type ChromaClientLike = {
|
|
53
|
+
getOrCreateCollection(params: {
|
|
54
|
+
name: string;
|
|
55
|
+
metadata?: Record<string, unknown>;
|
|
56
|
+
}): Promise<ChromaCollectionLike>;
|
|
57
|
+
};
|
|
58
|
+
export type ChromaDistanceMetric = "cosine" | "l2" | "ip";
|
|
59
|
+
export type ChromaVectorStoreOptions = {
|
|
60
|
+
/**
|
|
61
|
+
* The distance metric configured on the underlying Chroma collection(s)
|
|
62
|
+
* (Chroma's `hnsw:space`). Used only to convert returned distances into a
|
|
63
|
+
* `score`; see `src/lib/rag/stores/chroma.ts` module doc comment.
|
|
64
|
+
* Defaults to `"cosine"`.
|
|
65
|
+
*/
|
|
66
|
+
distanceMetric?: ChromaDistanceMetric;
|
|
67
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural types for the Chroma vector store adapter
|
|
3
|
+
* (`src/lib/rag/stores/chroma.ts`).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the subset of the `chromadb` package's API the adapter
|
|
6
|
+
* calls (`ChromaClient.getOrCreateCollection`, `Collection.upsert/query/
|
|
7
|
+
* delete`). NeuroLink has zero runtime dependency on `chromadb` — callers
|
|
8
|
+
* construct their own client and inject an object satisfying
|
|
9
|
+
* `ChromaClientLike`.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural types for the Pinecone vector store adapter
|
|
3
|
+
* (`src/lib/rag/stores/pinecone.ts`).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the subset of the `@pinecone-database/pinecone` package's API
|
|
6
|
+
* the adapter calls (`Index.query/upsert/deleteMany`, optional
|
|
7
|
+
* `Index.namespace`). NeuroLink has zero runtime dependency on the Pinecone
|
|
8
|
+
* SDK — callers construct their own client/index and inject an object
|
|
9
|
+
* satisfying `PineconeIndexLike`.
|
|
10
|
+
*/
|
|
11
|
+
/** A single scored match as returned by Pinecone's query API. */
|
|
12
|
+
export type PineconeMatch = {
|
|
13
|
+
id: string;
|
|
14
|
+
score?: number;
|
|
15
|
+
values?: number[];
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
/** Shape of the response returned by `PineconeIndexLike.query()`. */
|
|
19
|
+
export type PineconeQueryResponse = {
|
|
20
|
+
matches?: PineconeMatch[];
|
|
21
|
+
};
|
|
22
|
+
/** Request payload accepted by `PineconeIndexLike.query()`. */
|
|
23
|
+
export type PineconeQueryRequest = {
|
|
24
|
+
vector: number[];
|
|
25
|
+
topK: number;
|
|
26
|
+
filter?: Record<string, unknown>;
|
|
27
|
+
includeMetadata?: boolean;
|
|
28
|
+
includeValues?: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** A single record accepted by `PineconeIndexLike.upsert()`. */
|
|
31
|
+
export type PineconeUpsertRecord = {
|
|
32
|
+
id: string;
|
|
33
|
+
values: number[];
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Minimal structural interface modeled on the `@pinecone-database/pinecone`
|
|
38
|
+
* `Index` object. Satisfied by the real SDK's `Index` without modification;
|
|
39
|
+
* callers never need to install the Pinecone SDK as a dependency of this
|
|
40
|
+
* package — they bring their own already-constructed client instance.
|
|
41
|
+
*/
|
|
42
|
+
export type PineconeIndexLike = {
|
|
43
|
+
/** Returns a client scoped to the given namespace, if the client supports namespacing. */
|
|
44
|
+
namespace?(ns: string): PineconeIndexLike;
|
|
45
|
+
query(request: PineconeQueryRequest): Promise<PineconeQueryResponse>;
|
|
46
|
+
upsert(records: PineconeUpsertRecord[]): Promise<unknown>;
|
|
47
|
+
deleteMany(ids: string[]): Promise<unknown>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural types for the Pinecone vector store adapter
|
|
3
|
+
* (`src/lib/rag/stores/pinecone.ts`).
|
|
4
|
+
*
|
|
5
|
+
* These mirror the subset of the `@pinecone-database/pinecone` package's API
|
|
6
|
+
* the adapter calls (`Index.query/upsert/deleteMany`, optional
|
|
7
|
+
* `Index.namespace`). NeuroLink has zero runtime dependency on the Pinecone
|
|
8
|
+
* SDK — callers construct their own client/index and inject an object
|
|
9
|
+
* satisfying `PineconeIndexLike`.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.90.0",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
|
-
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (
|
|
5
|
+
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Juspay Technologies",
|
|
8
8
|
"email": "support@juspay.in",
|
|
@@ -93,6 +93,9 @@
|
|
|
93
93
|
"test:mcp:infra": "npx tsx test/continuous-test-suite-mcp-infra.ts",
|
|
94
94
|
"test:providers-mocked": "npx tsx test/continuous-test-suite-providers-mocked.ts",
|
|
95
95
|
"test:rag": "npx tsx test/continuous-test-suite-rag.ts",
|
|
96
|
+
"test:vector-pinecone": "npx tsx test/continuous-test-suite-vector-pinecone.ts",
|
|
97
|
+
"test:vector-pgvector": "npx tsx test/continuous-test-suite-vector-pgvector.ts",
|
|
98
|
+
"test:vector-chroma": "npx tsx test/continuous-test-suite-vector-chroma.ts",
|
|
96
99
|
"test:skills": "npx tsx test/continuous-test-suite-skills.ts",
|
|
97
100
|
"test:servers": "npx tsx test/continuous-test-suite-servers.ts",
|
|
98
101
|
"test:tool-reliability": "npx tsx test/continuous-test-suite-tool-reliability.ts",
|
|
@@ -332,15 +335,9 @@
|
|
|
332
335
|
"@ai-sdk/provider": "^3.0.8",
|
|
333
336
|
"@anthropic-ai/sdk": "^0.102.0",
|
|
334
337
|
"@anthropic-ai/vertex-sdk": "^0.16.0",
|
|
335
|
-
"@aws-sdk/client-bedrock": "^3.1000.0",
|
|
336
|
-
"@aws-sdk/client-bedrock-runtime": "^3.1000.0",
|
|
337
338
|
"@aws-sdk/client-sagemaker-runtime": "^3.1000.0",
|
|
338
|
-
"@aws-sdk/credential-provider-node": "^3.886.0",
|
|
339
339
|
"@aws-sdk/types": "^3.862.0",
|
|
340
|
-
"@google-cloud/text-to-speech": "^6.4.0",
|
|
341
|
-
"@google-cloud/vertexai": "^1.10.0",
|
|
342
340
|
"@google/genai": "^1.43.0",
|
|
343
|
-
"@huggingface/inference": "^4.13.14",
|
|
344
341
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
345
342
|
"@opentelemetry/api-logs": "^0.214.0",
|
|
346
343
|
"@opentelemetry/context-async-hooks": "^2.6.1",
|
|
@@ -399,10 +396,16 @@
|
|
|
399
396
|
}
|
|
400
397
|
},
|
|
401
398
|
"optionalDependencies": {
|
|
399
|
+
"@aws-sdk/client-bedrock": "^3.1000.0",
|
|
400
|
+
"@aws-sdk/client-bedrock-runtime": "^3.1000.0",
|
|
402
401
|
"@aws-sdk/client-sagemaker": "^3.1000.0",
|
|
402
|
+
"@aws-sdk/credential-provider-node": "^3.886.0",
|
|
403
403
|
"@fastify/cors": "^11.2.0",
|
|
404
404
|
"@fastify/rate-limit": "^10.3.0",
|
|
405
|
+
"@google-cloud/text-to-speech": "^6.4.0",
|
|
406
|
+
"@google-cloud/vertexai": "^1.10.0",
|
|
405
407
|
"@hono/node-server": "^1.19.13",
|
|
408
|
+
"@huggingface/inference": "^4.13.14",
|
|
406
409
|
"@koa/cors": "^5.0.0",
|
|
407
410
|
"@koa/router": "^15.3.1",
|
|
408
411
|
"@langfuse/otel": "^5.0.1",
|
|
@@ -442,6 +445,7 @@
|
|
|
442
445
|
"@biomejs/biome": "^2.4.4",
|
|
443
446
|
"@changesets/changelog-github": "^0.6.0",
|
|
444
447
|
"@changesets/cli": "^2.29.8",
|
|
448
|
+
"@electric-sql/pglite": "^0.4.6",
|
|
445
449
|
"@eslint/js": "^10.0.1",
|
|
446
450
|
"@juspay/hippocampus": ">=0.1.7",
|
|
447
451
|
"@opentelemetry/api": "^1.9.0",
|