@forinda/kickjs-ai 2.3.0 → 2.3.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.
- package/README.md +157 -26
- package/dist/index.d.mts +141 -140
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +14 -3
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
# @forinda/kickjs-ai
|
|
2
2
|
|
|
3
|
-
AI runtime for KickJS.
|
|
3
|
+
AI runtime for KickJS. Ships provider bindings, an `@AiTool` decorator that turns controller endpoints into model-callable functions, a memory layer for multi-turn chat, RAG primitives with four backends, and an agent loop that drives chat → tool → dispatch → feedback cycles through the normal Express pipeline.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
7
|
+
- **Providers** — built-in `OpenAIProvider` and `AnthropicProvider`, plus any OpenAI-compatible endpoint (Ollama, OpenRouter, vLLM, LocalAI, Azure OpenAI) via a `baseURL` override. Every provider implements `chat()`, `stream()`, and `embed()` against a single normalized interface.
|
|
8
|
+
- **`@AiTool` + agent loop** — decorate any controller method and `AiAdapter.runAgent` routes tool calls through internal HTTP dispatch so middleware, auth, validation, and logging still apply.
|
|
9
|
+
- **Chat memory** — `ChatMemory` interface with `InMemoryChatMemory` and a `SlidingWindowChatMemory` wrapper that caps history and pins the system prompt. `runAgentWithMemory` handles the turn-to-turn persistence for you.
|
|
10
|
+
- **Prompts** — `createPrompt<TVars>` runtime template engine with `{{variable}}` substitution, typed placeholders, and configurable missing-variable handling.
|
|
11
|
+
- **RAG** — four `VectorStore` implementations behind the same interface:
|
|
12
|
+
- `InMemoryVectorStore` — zero deps, cosine similarity, good for tests and prototypes
|
|
13
|
+
- `PgVectorStore` — pgvector-backed, duck-typed `SqlExecutor` so it works with `pg.Pool`, Drizzle's `$client`, or any `query()`-shaped shim
|
|
14
|
+
- `QdrantVectorStore` — REST client with lazy collection bootstrap and equality-map filter translation
|
|
15
|
+
- `PineconeVectorStore` — REST client with namespace support and MongoDB-style filter DSL passthrough
|
|
16
|
+
- **`RagService`** — ties a provider's embeddings to any `VectorStore` and adds `index`, `search`, and `augmentChatInput` helpers.
|
|
15
17
|
|
|
16
18
|
## Install
|
|
17
19
|
|
|
@@ -19,40 +21,42 @@ AI runtime for KickJS. Provides a provider abstraction, an `@AiTool` decorator f
|
|
|
19
21
|
pnpm add @forinda/kickjs-ai
|
|
20
22
|
```
|
|
21
23
|
|
|
22
|
-
Zod is a peer dependency
|
|
24
|
+
Zod is a peer dependency. No other runtime is required — the built-in providers talk to upstream APIs over `fetch`.
|
|
23
25
|
|
|
24
|
-
##
|
|
26
|
+
## Quick start
|
|
25
27
|
|
|
26
28
|
```ts
|
|
27
|
-
import { bootstrap } from '@forinda/kickjs'
|
|
28
|
-
import { AiAdapter } from '@forinda/kickjs-ai'
|
|
29
|
-
import { OpenAIProvider } from '@forinda/kickjs-ai/providers/openai'
|
|
29
|
+
import { bootstrap, getEnv } from '@forinda/kickjs'
|
|
30
|
+
import { AiAdapter, OpenAIProvider } from '@forinda/kickjs-ai'
|
|
30
31
|
import { modules } from './modules'
|
|
31
32
|
|
|
32
33
|
export const app = await bootstrap({
|
|
33
34
|
modules,
|
|
34
35
|
adapters: [
|
|
35
36
|
new AiAdapter({
|
|
36
|
-
provider: new OpenAIProvider({
|
|
37
|
+
provider: new OpenAIProvider({
|
|
38
|
+
apiKey: getEnv('OPENAI_API_KEY'),
|
|
39
|
+
defaultChatModel: 'gpt-4o-mini',
|
|
40
|
+
}),
|
|
37
41
|
}),
|
|
38
42
|
],
|
|
39
43
|
})
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
Inject the
|
|
46
|
+
Inject the adapter anywhere:
|
|
43
47
|
|
|
44
48
|
```ts
|
|
45
|
-
import { Service,
|
|
46
|
-
import {
|
|
49
|
+
import { Service, Autowired } from '@forinda/kickjs'
|
|
50
|
+
import { AiAdapter } from '@forinda/kickjs-ai'
|
|
47
51
|
|
|
48
52
|
@Service()
|
|
49
53
|
export class SummarizeService {
|
|
50
|
-
|
|
54
|
+
@Autowired() private readonly ai!: AiAdapter
|
|
51
55
|
|
|
52
56
|
async summarize(text: string): Promise<string> {
|
|
53
|
-
const res = await this.ai.chat({
|
|
57
|
+
const res = await this.ai.getProvider().chat({
|
|
54
58
|
messages: [
|
|
55
|
-
{ role: 'system', content: 'Summarize
|
|
59
|
+
{ role: 'system', content: 'Summarize in two sentences.' },
|
|
56
60
|
{ role: 'user', content: text },
|
|
57
61
|
],
|
|
58
62
|
})
|
|
@@ -61,9 +65,22 @@ export class SummarizeService {
|
|
|
61
65
|
}
|
|
62
66
|
```
|
|
63
67
|
|
|
64
|
-
##
|
|
68
|
+
## Anthropic
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { AnthropicProvider } from '@forinda/kickjs-ai'
|
|
72
|
+
|
|
73
|
+
new AnthropicProvider({
|
|
74
|
+
apiKey: getEnv('ANTHROPIC_API_KEY'),
|
|
75
|
+
defaultChatModel: 'claude-opus-4-6',
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Anthropic does not ship an embeddings API — `embed()` throws a descriptive error. For RAG workflows pair it with `OpenAIProvider` for embeddings.
|
|
80
|
+
|
|
81
|
+
## `@AiTool` — endpoints as tool calls
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
Because Zod schemas already power route validation, they also power tool definitions — no duplicated type declarations:
|
|
67
84
|
|
|
68
85
|
```ts
|
|
69
86
|
import { Controller, Post, type Ctx } from '@forinda/kickjs'
|
|
@@ -73,14 +90,128 @@ import { createTaskSchema } from './dtos/create-task.dto'
|
|
|
73
90
|
@Controller('/tasks')
|
|
74
91
|
export class TaskController {
|
|
75
92
|
@Post('/', { body: createTaskSchema, name: 'CreateTask' })
|
|
76
|
-
@AiTool({
|
|
93
|
+
@AiTool({
|
|
94
|
+
name: 'create_task',
|
|
95
|
+
description: 'Create a new task with title and priority',
|
|
96
|
+
inputSchema: createTaskSchema,
|
|
97
|
+
})
|
|
77
98
|
create(ctx: Ctx<KickRoutes.TaskController['create']>) {
|
|
78
99
|
return this.createTaskUseCase.execute(ctx.body)
|
|
79
100
|
}
|
|
80
101
|
}
|
|
81
102
|
```
|
|
82
103
|
|
|
83
|
-
|
|
104
|
+
Run an agent loop:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
const result = await this.ai.runAgent({
|
|
108
|
+
messages: [
|
|
109
|
+
{ role: 'system', content: 'You create tasks for the team.' },
|
|
110
|
+
{ role: 'user', content: 'Add a high-priority task to ship the release' },
|
|
111
|
+
],
|
|
112
|
+
tools: 'auto', // every @AiTool in the registry
|
|
113
|
+
maxSteps: 5,
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
console.log(result.content) // final assistant text
|
|
117
|
+
console.log(result.toolCalls) // audit trail of calls
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Tool dispatch happens through internal HTTP requests against the running KickJS server, so middleware, auth guards, validation, and logging run exactly the same way they do for external callers.
|
|
121
|
+
|
|
122
|
+
## Chat memory
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { InMemoryChatMemory, SlidingWindowChatMemory } from '@forinda/kickjs-ai'
|
|
126
|
+
|
|
127
|
+
const memory = new SlidingWindowChatMemory({
|
|
128
|
+
inner: new InMemoryChatMemory(),
|
|
129
|
+
maxMessages: 20,
|
|
130
|
+
pinSystemPrompt: true,
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const result = await this.ai.runAgentWithMemory({
|
|
134
|
+
memory,
|
|
135
|
+
userMessage: 'What did I just ask you?',
|
|
136
|
+
systemPrompt: 'You are a helpful assistant.',
|
|
137
|
+
tools: 'auto',
|
|
138
|
+
})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`runAgentWithMemory` pins the system prompt on the first turn, persists user and assistant messages automatically, and drops large tool results from memory by default (override with `persistToolResults: true` for full-transcript replay).
|
|
142
|
+
|
|
143
|
+
## RAG
|
|
144
|
+
|
|
145
|
+
Every backend implements the same `VectorStore<M>` interface, so services that consume the `VECTOR_STORE` DI token never need to know which store is wired in:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
import { bootstrap, getEnv } from '@forinda/kickjs'
|
|
149
|
+
import {
|
|
150
|
+
AiAdapter,
|
|
151
|
+
OpenAIProvider,
|
|
152
|
+
QdrantVectorStore,
|
|
153
|
+
VECTOR_STORE,
|
|
154
|
+
} from '@forinda/kickjs-ai'
|
|
155
|
+
|
|
156
|
+
const store = new QdrantVectorStore({
|
|
157
|
+
url: getEnv('QDRANT_URL'),
|
|
158
|
+
apiKey: getEnv('QDRANT_API_KEY'),
|
|
159
|
+
collection: 'docs',
|
|
160
|
+
dimensions: 1536,
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
export const app = await bootstrap({
|
|
164
|
+
modules,
|
|
165
|
+
adapters: [
|
|
166
|
+
new AiAdapter({
|
|
167
|
+
provider: new OpenAIProvider({ apiKey: getEnv('OPENAI_API_KEY') }),
|
|
168
|
+
}),
|
|
169
|
+
],
|
|
170
|
+
plugins: [
|
|
171
|
+
{
|
|
172
|
+
name: 'vector-store',
|
|
173
|
+
register(container) {
|
|
174
|
+
container.registerInstance(VECTOR_STORE, store)
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
})
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Index and query with `RagService`:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
import { Service, Autowired, Inject } from '@forinda/kickjs'
|
|
185
|
+
import { AiAdapter, RagService, VECTOR_STORE, type VectorStore } from '@forinda/kickjs-ai'
|
|
186
|
+
|
|
187
|
+
@Service()
|
|
188
|
+
export class KnowledgeService {
|
|
189
|
+
private readonly rag: RagService
|
|
190
|
+
|
|
191
|
+
constructor(
|
|
192
|
+
@Autowired() ai: AiAdapter,
|
|
193
|
+
@Inject(VECTOR_STORE) store: VectorStore,
|
|
194
|
+
) {
|
|
195
|
+
this.rag = new RagService({ provider: ai.getProvider(), store })
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async ask(question: string) {
|
|
199
|
+
const input = await this.rag.augmentChatInput(
|
|
200
|
+
{ messages: [{ role: 'user', content: question }] },
|
|
201
|
+
question,
|
|
202
|
+
{ topK: 4 },
|
|
203
|
+
)
|
|
204
|
+
const res = await this.rag.getProvider().chat(input)
|
|
205
|
+
return res.content
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Documentation
|
|
211
|
+
|
|
212
|
+
Full usage guide: [kickjs.dev/guide/ai](https://forinda.github.io/kick-js/guide/ai)
|
|
213
|
+
|
|
214
|
+
Related: [`@forinda/kickjs-mcp`](../mcp) exposes the same `@AiTool` methods to external Model Context Protocol clients (Claude Code, Cursor, Zed).
|
|
84
215
|
|
|
85
216
|
## License
|
|
86
217
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import * as _$_forinda_kickjs0 from "@forinda/kickjs";
|
|
2
3
|
import { AdapterContext, AppAdapter, Constructor } from "@forinda/kickjs";
|
|
3
4
|
import { ZodTypeAny } from "zod";
|
|
4
5
|
|
|
@@ -605,6 +606,143 @@ declare function getAiToolMeta(target: object, method: string): AiToolOptions |
|
|
|
605
606
|
/** Check whether a method was decorated with `@AiTool`. */
|
|
606
607
|
declare function isAiTool(target: object, method: string): boolean;
|
|
607
608
|
//#endregion
|
|
609
|
+
//#region src/rag/types.d.ts
|
|
610
|
+
/**
|
|
611
|
+
* RAG primitive types.
|
|
612
|
+
*
|
|
613
|
+
* The `VectorStore` interface is the contract every backend (in-memory,
|
|
614
|
+
* pgvector, Qdrant, Pinecone) implements. The framework's own `RagService`
|
|
615
|
+
* takes any `VectorStore` + an `AiProvider` and produces retrieval-
|
|
616
|
+
* augmented chat helpers, so swapping storage backends is a one-line
|
|
617
|
+
* change to the DI binding — services that consume `VECTOR_STORE` stay
|
|
618
|
+
* the same.
|
|
619
|
+
*
|
|
620
|
+
* The shapes here are deliberately minimal. Vendor-specific features
|
|
621
|
+
* (hybrid search, reranking, sparse vectors) live on the concrete
|
|
622
|
+
* implementations as extensions, not on this interface.
|
|
623
|
+
*
|
|
624
|
+
* @module @forinda/kickjs-ai/rag/types
|
|
625
|
+
*/
|
|
626
|
+
/**
|
|
627
|
+
* A single document stored in a vector store.
|
|
628
|
+
*
|
|
629
|
+
* The `content` field carries the original text — the vector alone
|
|
630
|
+
* isn't enough because RAG retrieval needs to feed the original text
|
|
631
|
+
* back into the LLM context. `metadata` is the escape hatch for
|
|
632
|
+
* anything the application wants to filter or track (author, date,
|
|
633
|
+
* tags, tenant ID, etc.).
|
|
634
|
+
*
|
|
635
|
+
* @typeParam M — the metadata shape; defaults to a loose record so
|
|
636
|
+
* users don't need to parameterize the type unless they want the
|
|
637
|
+
* extra rigor.
|
|
638
|
+
*/
|
|
639
|
+
interface VectorDocument<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
640
|
+
/** Unique identifier — repeated upsert with the same id replaces the previous version. */
|
|
641
|
+
id: string;
|
|
642
|
+
/** Original text the vector was computed from. */
|
|
643
|
+
content: string;
|
|
644
|
+
/** Dense embedding. Length must match the store's configured dimensions. */
|
|
645
|
+
vector: number[];
|
|
646
|
+
/** Optional arbitrary metadata used for filtering and display. */
|
|
647
|
+
metadata?: M;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* A single search result from `VectorStore.query`.
|
|
651
|
+
*
|
|
652
|
+
* `score` is normalized across backends: higher = more similar.
|
|
653
|
+
* Cosine similarity returns values in [-1, 1]; most backends clamp to
|
|
654
|
+
* [0, 1] for usability. Services should treat the number as a
|
|
655
|
+
* monotonic rank, not an absolute probability.
|
|
656
|
+
*/
|
|
657
|
+
interface VectorSearchHit<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
658
|
+
id: string;
|
|
659
|
+
content: string;
|
|
660
|
+
score: number;
|
|
661
|
+
metadata?: M;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Options for `VectorStore.query`.
|
|
665
|
+
*
|
|
666
|
+
* `filter` is an equality map against `metadata` — backends that
|
|
667
|
+
* support richer predicates (range, $in, $not) should accept them
|
|
668
|
+
* here as well, using the MongoDB-style operator prefix convention.
|
|
669
|
+
* The in-memory store implements equality only, which is enough for
|
|
670
|
+
* most v0 use cases.
|
|
671
|
+
*/
|
|
672
|
+
interface VectorQueryOptions {
|
|
673
|
+
/** The embedding of the query text. */
|
|
674
|
+
vector: number[];
|
|
675
|
+
/** Maximum number of hits to return. Defaults to 5. */
|
|
676
|
+
topK?: number;
|
|
677
|
+
/** Metadata equality filter. Hits whose metadata doesn't match are dropped. */
|
|
678
|
+
filter?: Record<string, unknown>;
|
|
679
|
+
/** Drop hits whose score falls below this threshold. */
|
|
680
|
+
minScore?: number;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Vector store contract. Backends:
|
|
684
|
+
* - `InMemoryVectorStore` — in-package, zero deps, perfect for tests
|
|
685
|
+
* and prototypes; up to a few thousand docs before linear scan hurts
|
|
686
|
+
* - pgvector — runs inside any Postgres 13+ KickJS project (follow-up commit)
|
|
687
|
+
* - Qdrant — dedicated vector DB with payload filtering (follow-up commit)
|
|
688
|
+
* - Pinecone — managed cloud service (follow-up commit)
|
|
689
|
+
*
|
|
690
|
+
* Implementations must honor two contracts: upserts are idempotent on
|
|
691
|
+
* id, and query results are ordered by descending score.
|
|
692
|
+
*/
|
|
693
|
+
interface VectorStore<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
694
|
+
/** Short identifier for logs, e.g. `'in-memory'`, `'pgvector'`. */
|
|
695
|
+
readonly name: string;
|
|
696
|
+
/**
|
|
697
|
+
* Insert or replace one or more documents. Re-upserting an existing
|
|
698
|
+
* id overwrites its vector, content, and metadata.
|
|
699
|
+
*/
|
|
700
|
+
upsert(doc: VectorDocument<M> | VectorDocument<M>[]): Promise<void>;
|
|
701
|
+
/**
|
|
702
|
+
* Search for the nearest vectors. Results are ordered by descending
|
|
703
|
+
* score, capped at `options.topK` (default 5), and filtered by
|
|
704
|
+
* `options.filter` / `options.minScore` if provided.
|
|
705
|
+
*/
|
|
706
|
+
query(options: VectorQueryOptions): Promise<VectorSearchHit<M>[]>;
|
|
707
|
+
/** Remove documents by id. Missing ids are silently ignored. */
|
|
708
|
+
delete(id: string | string[]): Promise<void>;
|
|
709
|
+
/** Clear every document from the store. Mostly for tests and admin tools. */
|
|
710
|
+
deleteAll(): Promise<void>;
|
|
711
|
+
/** Optional count — not every backend supports it cheaply. */
|
|
712
|
+
count?(): Promise<number>;
|
|
713
|
+
}
|
|
714
|
+
/** Input to `RagService.index`. */
|
|
715
|
+
interface RagIndexInput<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
716
|
+
id: string;
|
|
717
|
+
content: string;
|
|
718
|
+
metadata?: M;
|
|
719
|
+
}
|
|
720
|
+
/** Options for `RagService.search` / `RagService.augmentChatInput`. */
|
|
721
|
+
interface RagSearchOptions {
|
|
722
|
+
/** Maximum number of documents to retrieve. Defaults to 5. */
|
|
723
|
+
topK?: number;
|
|
724
|
+
/** Metadata equality filter forwarded to the underlying store. */
|
|
725
|
+
filter?: Record<string, unknown>;
|
|
726
|
+
/** Drop hits whose similarity score falls below this threshold. */
|
|
727
|
+
minScore?: number;
|
|
728
|
+
}
|
|
729
|
+
/** Options for `RagService.augmentChatInput`. */
|
|
730
|
+
interface RagAugmentOptions extends RagSearchOptions {
|
|
731
|
+
/**
|
|
732
|
+
* Template for the retrieved-context system message. `{documents}`
|
|
733
|
+
* is replaced with the concatenated document contents. If omitted,
|
|
734
|
+
* a sensible default is used.
|
|
735
|
+
*/
|
|
736
|
+
systemTemplate?: string;
|
|
737
|
+
/**
|
|
738
|
+
* When true, prepend the context as a NEW system message. When false
|
|
739
|
+
* (the default), merge into the first existing system message or
|
|
740
|
+
* prepend if none exists. The merge path avoids producing chat
|
|
741
|
+
* histories with two competing system prompts, which confuses models.
|
|
742
|
+
*/
|
|
743
|
+
asSeparateSystemMessage?: boolean;
|
|
744
|
+
}
|
|
745
|
+
//#endregion
|
|
608
746
|
//#region src/constants.d.ts
|
|
609
747
|
/**
|
|
610
748
|
* Metadata key for the `@AiTool` decorator.
|
|
@@ -616,7 +754,7 @@ declare function isAiTool(target: object, method: string): boolean;
|
|
|
616
754
|
* guarantees that two separate definitions can never shadow each other
|
|
617
755
|
* even if the package is loaded more than once.
|
|
618
756
|
*/
|
|
619
|
-
declare const AI_TOOL_METADATA:
|
|
757
|
+
declare const AI_TOOL_METADATA: _$_forinda_kickjs0.InjectionToken<AiToolOptions>;
|
|
620
758
|
/**
|
|
621
759
|
* DI token for the active AI provider.
|
|
622
760
|
*
|
|
@@ -642,7 +780,7 @@ declare const AI_TOOL_METADATA: any;
|
|
|
642
780
|
* }
|
|
643
781
|
* ```
|
|
644
782
|
*/
|
|
645
|
-
declare const AI_PROVIDER:
|
|
783
|
+
declare const AI_PROVIDER: _$_forinda_kickjs0.InjectionToken<AiProvider>;
|
|
646
784
|
/**
|
|
647
785
|
* DI token for the active vector store backend.
|
|
648
786
|
*
|
|
@@ -675,7 +813,7 @@ declare const AI_PROVIDER: any;
|
|
|
675
813
|
* })
|
|
676
814
|
* ```
|
|
677
815
|
*/
|
|
678
|
-
declare const VECTOR_STORE:
|
|
816
|
+
declare const VECTOR_STORE: _$_forinda_kickjs0.InjectionToken<VectorStore<Record<string, unknown>>>;
|
|
679
817
|
//#endregion
|
|
680
818
|
//#region src/providers/openai.d.ts
|
|
681
819
|
/**
|
|
@@ -1229,143 +1367,6 @@ declare class SlidingWindowChatMemory implements ChatMemory {
|
|
|
1229
1367
|
private applyWindow;
|
|
1230
1368
|
}
|
|
1231
1369
|
//#endregion
|
|
1232
|
-
//#region src/rag/types.d.ts
|
|
1233
|
-
/**
|
|
1234
|
-
* RAG primitive types.
|
|
1235
|
-
*
|
|
1236
|
-
* The `VectorStore` interface is the contract every backend (in-memory,
|
|
1237
|
-
* pgvector, Qdrant, Pinecone) implements. The framework's own `RagService`
|
|
1238
|
-
* takes any `VectorStore` + an `AiProvider` and produces retrieval-
|
|
1239
|
-
* augmented chat helpers, so swapping storage backends is a one-line
|
|
1240
|
-
* change to the DI binding — services that consume `VECTOR_STORE` stay
|
|
1241
|
-
* the same.
|
|
1242
|
-
*
|
|
1243
|
-
* The shapes here are deliberately minimal. Vendor-specific features
|
|
1244
|
-
* (hybrid search, reranking, sparse vectors) live on the concrete
|
|
1245
|
-
* implementations as extensions, not on this interface.
|
|
1246
|
-
*
|
|
1247
|
-
* @module @forinda/kickjs-ai/rag/types
|
|
1248
|
-
*/
|
|
1249
|
-
/**
|
|
1250
|
-
* A single document stored in a vector store.
|
|
1251
|
-
*
|
|
1252
|
-
* The `content` field carries the original text — the vector alone
|
|
1253
|
-
* isn't enough because RAG retrieval needs to feed the original text
|
|
1254
|
-
* back into the LLM context. `metadata` is the escape hatch for
|
|
1255
|
-
* anything the application wants to filter or track (author, date,
|
|
1256
|
-
* tags, tenant ID, etc.).
|
|
1257
|
-
*
|
|
1258
|
-
* @typeParam M — the metadata shape; defaults to a loose record so
|
|
1259
|
-
* users don't need to parameterize the type unless they want the
|
|
1260
|
-
* extra rigor.
|
|
1261
|
-
*/
|
|
1262
|
-
interface VectorDocument<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
1263
|
-
/** Unique identifier — repeated upsert with the same id replaces the previous version. */
|
|
1264
|
-
id: string;
|
|
1265
|
-
/** Original text the vector was computed from. */
|
|
1266
|
-
content: string;
|
|
1267
|
-
/** Dense embedding. Length must match the store's configured dimensions. */
|
|
1268
|
-
vector: number[];
|
|
1269
|
-
/** Optional arbitrary metadata used for filtering and display. */
|
|
1270
|
-
metadata?: M;
|
|
1271
|
-
}
|
|
1272
|
-
/**
|
|
1273
|
-
* A single search result from `VectorStore.query`.
|
|
1274
|
-
*
|
|
1275
|
-
* `score` is normalized across backends: higher = more similar.
|
|
1276
|
-
* Cosine similarity returns values in [-1, 1]; most backends clamp to
|
|
1277
|
-
* [0, 1] for usability. Services should treat the number as a
|
|
1278
|
-
* monotonic rank, not an absolute probability.
|
|
1279
|
-
*/
|
|
1280
|
-
interface VectorSearchHit<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
1281
|
-
id: string;
|
|
1282
|
-
content: string;
|
|
1283
|
-
score: number;
|
|
1284
|
-
metadata?: M;
|
|
1285
|
-
}
|
|
1286
|
-
/**
|
|
1287
|
-
* Options for `VectorStore.query`.
|
|
1288
|
-
*
|
|
1289
|
-
* `filter` is an equality map against `metadata` — backends that
|
|
1290
|
-
* support richer predicates (range, $in, $not) should accept them
|
|
1291
|
-
* here as well, using the MongoDB-style operator prefix convention.
|
|
1292
|
-
* The in-memory store implements equality only, which is enough for
|
|
1293
|
-
* most v0 use cases.
|
|
1294
|
-
*/
|
|
1295
|
-
interface VectorQueryOptions {
|
|
1296
|
-
/** The embedding of the query text. */
|
|
1297
|
-
vector: number[];
|
|
1298
|
-
/** Maximum number of hits to return. Defaults to 5. */
|
|
1299
|
-
topK?: number;
|
|
1300
|
-
/** Metadata equality filter. Hits whose metadata doesn't match are dropped. */
|
|
1301
|
-
filter?: Record<string, unknown>;
|
|
1302
|
-
/** Drop hits whose score falls below this threshold. */
|
|
1303
|
-
minScore?: number;
|
|
1304
|
-
}
|
|
1305
|
-
/**
|
|
1306
|
-
* Vector store contract. Backends:
|
|
1307
|
-
* - `InMemoryVectorStore` — in-package, zero deps, perfect for tests
|
|
1308
|
-
* and prototypes; up to a few thousand docs before linear scan hurts
|
|
1309
|
-
* - pgvector — runs inside any Postgres 13+ KickJS project (follow-up commit)
|
|
1310
|
-
* - Qdrant — dedicated vector DB with payload filtering (follow-up commit)
|
|
1311
|
-
* - Pinecone — managed cloud service (follow-up commit)
|
|
1312
|
-
*
|
|
1313
|
-
* Implementations must honor two contracts: upserts are idempotent on
|
|
1314
|
-
* id, and query results are ordered by descending score.
|
|
1315
|
-
*/
|
|
1316
|
-
interface VectorStore<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
1317
|
-
/** Short identifier for logs, e.g. `'in-memory'`, `'pgvector'`. */
|
|
1318
|
-
readonly name: string;
|
|
1319
|
-
/**
|
|
1320
|
-
* Insert or replace one or more documents. Re-upserting an existing
|
|
1321
|
-
* id overwrites its vector, content, and metadata.
|
|
1322
|
-
*/
|
|
1323
|
-
upsert(doc: VectorDocument<M> | VectorDocument<M>[]): Promise<void>;
|
|
1324
|
-
/**
|
|
1325
|
-
* Search for the nearest vectors. Results are ordered by descending
|
|
1326
|
-
* score, capped at `options.topK` (default 5), and filtered by
|
|
1327
|
-
* `options.filter` / `options.minScore` if provided.
|
|
1328
|
-
*/
|
|
1329
|
-
query(options: VectorQueryOptions): Promise<VectorSearchHit<M>[]>;
|
|
1330
|
-
/** Remove documents by id. Missing ids are silently ignored. */
|
|
1331
|
-
delete(id: string | string[]): Promise<void>;
|
|
1332
|
-
/** Clear every document from the store. Mostly for tests and admin tools. */
|
|
1333
|
-
deleteAll(): Promise<void>;
|
|
1334
|
-
/** Optional count — not every backend supports it cheaply. */
|
|
1335
|
-
count?(): Promise<number>;
|
|
1336
|
-
}
|
|
1337
|
-
/** Input to `RagService.index`. */
|
|
1338
|
-
interface RagIndexInput<M extends Record<string, unknown> = Record<string, unknown>> {
|
|
1339
|
-
id: string;
|
|
1340
|
-
content: string;
|
|
1341
|
-
metadata?: M;
|
|
1342
|
-
}
|
|
1343
|
-
/** Options for `RagService.search` / `RagService.augmentChatInput`. */
|
|
1344
|
-
interface RagSearchOptions {
|
|
1345
|
-
/** Maximum number of documents to retrieve. Defaults to 5. */
|
|
1346
|
-
topK?: number;
|
|
1347
|
-
/** Metadata equality filter forwarded to the underlying store. */
|
|
1348
|
-
filter?: Record<string, unknown>;
|
|
1349
|
-
/** Drop hits whose similarity score falls below this threshold. */
|
|
1350
|
-
minScore?: number;
|
|
1351
|
-
}
|
|
1352
|
-
/** Options for `RagService.augmentChatInput`. */
|
|
1353
|
-
interface RagAugmentOptions extends RagSearchOptions {
|
|
1354
|
-
/**
|
|
1355
|
-
* Template for the retrieved-context system message. `{documents}`
|
|
1356
|
-
* is replaced with the concatenated document contents. If omitted,
|
|
1357
|
-
* a sensible default is used.
|
|
1358
|
-
*/
|
|
1359
|
-
systemTemplate?: string;
|
|
1360
|
-
/**
|
|
1361
|
-
* When true, prepend the context as a NEW system message. When false
|
|
1362
|
-
* (the default), merge into the first existing system message or
|
|
1363
|
-
* prepend if none exists. The merge path avoids producing chat
|
|
1364
|
-
* histories with two competing system prompts, which confuses models.
|
|
1365
|
-
*/
|
|
1366
|
-
asSeparateSystemMessage?: boolean;
|
|
1367
|
-
}
|
|
1368
|
-
//#endregion
|
|
1369
1370
|
//#region src/rag/in-memory.d.ts
|
|
1370
1371
|
/**
|
|
1371
1372
|
* Zero-dependency in-memory vector store.
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/memory/types.ts","../src/ai.adapter.ts","../src/decorators.ts","../src/constants.ts","../src/providers/openai.ts","../src/providers/anthropic.ts","../src/providers/base.ts","../src/prompts/prompt.ts","../src/memory/in-memory.ts","../src/memory/sliding-window.ts","../src/rag/types.ts","../src/rag/in-memory.ts","../src/rag/pgvector.ts","../src/rag/qdrant.ts","../src/rag/pinecone.ts","../src/rag/rag-service.ts"],"mappings":";;;;;;;;AASA;;;;UAAiB,WAAA;EACf,IAAA;EACA,OAAA;EAIA;EAFA,UAAA;EAEoB;EAApB,SAAA,GAAY,KAAA;IAAQ,EAAA;IAAY,IAAA;IAAc,SAAA,EAAW,MAAA;EAAA;AAAA;;;;;;;;;;AAkC3D;;UApBiB,kBA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EACP,KAAA,UACA,OAAA,GAAS,iBAAA,GACR,OAAA,CAAQ,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/memory/types.ts","../src/ai.adapter.ts","../src/decorators.ts","../src/rag/types.ts","../src/constants.ts","../src/providers/openai.ts","../src/providers/anthropic.ts","../src/providers/base.ts","../src/prompts/prompt.ts","../src/memory/in-memory.ts","../src/memory/sliding-window.ts","../src/rag/in-memory.ts","../src/rag/pgvector.ts","../src/rag/qdrant.ts","../src/rag/pinecone.ts","../src/rag/rag-service.ts"],"mappings":";;;;;;;;;;AASA;;;UAAiB,WAAA;EACf,IAAA;EACA,OAAA;EAEA;EAAA,UAAA;EAEY;EAAZ,SAAA,GAAY,KAAA;IAAQ,EAAA;IAAY,IAAA;IAAc,SAAA,EAAW,MAAA;EAAA;AAAA;AAc3D;;;;;;;;;;AAoBA;AApBA,UAAiB,kBAAA;;EAEf,IAAA;EAoBA;EAlBA,WAAA;EAuBA;;;;;EAjBA,WAAA,EAAa,MAAA;AAAA;;;;;;;;UAUE,SAAA;EA6BK;EA3BpB,QAAA,EAAU,WAAA;EA+BK;;;;EA1Bf,KAAA;EA8BA;;;;;;;;;;;EAlBA,KAAA,YAAiB,kBAAA;AAAA;AA0BnB;AAAA,UAtBiB,WAAA;EACf,WAAA;EACA,SAAA;EACA,IAAA;EACA,aAAA;EAsBkB;EApBlB,MAAA,GAAS,WAAA;AAAA;;UAIM,YAAA;EAkBX;EAhBJ,OAAA;EAyBoB;EAvBpB,SAAA,GAAY,KAAA;IAAQ,EAAA;IAAY,IAAA;IAAc,SAAA,EAAW,MAAA;EAAA;;EAEzD,KAAA;IAAU,YAAA;IAAsB,gBAAA;IAA0B,WAAA;EAAA;EA8BzC;EA5BjB,YAAA;AAAA;;UAIe,SAAA;EAgCb;EA9BF,OAAA;EAsCyB;EApCzB,aAAA;IAAkB,EAAA;IAAY,IAAA;IAAe,cAAA;EAAA;EA0C/B;EAxCd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A;EAU/B,SAAA,CAAA,GAAa,OAAA;EAQb,KAAA,CAAA,GAAS,OAAA;Ef5GgB;;;;AAYjC;;EAZiC,QegIjB,OAAA;AAAA;;;;;;;;;;;;;;;;iBAqCA,mBAAA,CAAoB,MAAA,EAAQ,MAAA,oBAA0B,MAAA;;;;;;AftRtE;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;AAoBA;;;;;;;;;;;AAuBA;;;;;cgBXa,UAAA,WAAqB,MAAA,oBAA0B,MAAA;EAAA,iBAEvC,QAAA;EAAA,iBACA,KAAA;cADA,QAAA,EAAU,UAAA,EACV,KAAA,EAAO,WAAA,CAAY,CAAA;EhBc7B;EgBVT,WAAA,CAAA,GAAe,UAAA;EhBUK;EgBLpB,QAAA,CAAA,GAAY,WAAA,CAAY,CAAA;EhBSG;;;;;;;;;;;EgBMrB,KAAA,CAAM,IAAA,EAAM,aAAA,CAAc,CAAA,MAAO,OAAA;EhBAP;;;;;EgB0B1B,MAAA,CAAO,KAAA,UAAe,OAAA,GAAS,gBAAA,GAAwB,OAAA,CAAQ,eAAA,CAAgB,CAAA;EhBpB7D;;;;;;;;;;;AAe1B;;;;EgBgCQ,gBAAA,CACJ,KAAA,EAAO,SAAA,EACP,KAAA,UACA,OAAA,GAAS,iBAAA,GACR,OAAA,CAAQ,SAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forinda/kickjs-ai",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "AI runtime for KickJS — providers, @AiTool decorator, streaming, RAG, and agent loops",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kickjs",
|
|
@@ -23,8 +23,19 @@
|
|
|
23
23
|
"rag",
|
|
24
24
|
"vector-search",
|
|
25
25
|
"agent",
|
|
26
|
+
"qdrant",
|
|
27
|
+
"pinecone",
|
|
28
|
+
"pgvector",
|
|
29
|
+
"embeddings",
|
|
30
|
+
"chat-memory",
|
|
26
31
|
"@forinda/kickjs",
|
|
27
|
-
"@forinda/kickjs-
|
|
32
|
+
"@forinda/kickjs-ai",
|
|
33
|
+
"@forinda/kickjs-mcp",
|
|
34
|
+
"@forinda/kickjs-cli",
|
|
35
|
+
"@forinda/kickjs-config",
|
|
36
|
+
"@forinda/kickjs-swagger",
|
|
37
|
+
"@forinda/kickjs-auth",
|
|
38
|
+
"@forinda/kickjs-testing"
|
|
28
39
|
],
|
|
29
40
|
"type": "module",
|
|
30
41
|
"main": "dist/index.mjs",
|
|
@@ -57,7 +68,7 @@
|
|
|
57
68
|
},
|
|
58
69
|
"dependencies": {
|
|
59
70
|
"reflect-metadata": "^0.2.2",
|
|
60
|
-
"@forinda/kickjs": "2.3.
|
|
71
|
+
"@forinda/kickjs": "2.3.2"
|
|
61
72
|
},
|
|
62
73
|
"peerDependencies": {
|
|
63
74
|
"zod": "^4.3.6"
|