@yolk-sdk/knowledge 0.1.0-canary.13 → 0.1.0-canary.130
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 +160 -80
- package/dist/agent.d.mts +118 -19
- package/dist/agent.d.mts.map +1 -1
- package/dist/agent.mjs +256 -34
- package/dist/agent.mjs.map +1 -1
- package/dist/chunking.d.mts +13 -16
- package/dist/chunking.d.mts.map +1 -1
- package/dist/chunking.mjs +4 -4
- package/dist/chunking.mjs.map +1 -1
- package/dist/context.d.mts +4 -13
- package/dist/context.d.mts.map +1 -1
- package/dist/context.mjs +17 -13
- package/dist/context.mjs.map +1 -1
- package/dist/documents.d.mts +128 -78
- package/dist/documents.d.mts.map +1 -1
- package/dist/documents.mjs +89 -61
- package/dist/documents.mjs.map +1 -1
- package/dist/embeddings.d.mts +4 -7
- package/dist/embeddings.d.mts.map +1 -1
- package/dist/embeddings.mjs +1 -2
- package/dist/embeddings.mjs.map +1 -1
- package/dist/errors.d.mts +19 -22
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +12 -13
- package/dist/errors.mjs.map +1 -1
- package/dist/extraction.d.mts +4 -7
- package/dist/extraction.d.mts.map +1 -1
- package/dist/extraction.mjs +1 -2
- package/dist/extraction.mjs.map +1 -1
- package/dist/files.d.mts +19 -0
- package/dist/files.d.mts.map +1 -0
- package/dist/files.mjs +6 -0
- package/dist/files.mjs.map +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -4
- package/dist/ingestion.d.mts +21 -23
- package/dist/ingestion.d.mts.map +1 -1
- package/dist/ingestion.mjs +12 -17
- package/dist/ingestion.mjs.map +1 -1
- package/dist/search.d.mts +13 -17
- package/dist/search.d.mts.map +1 -1
- package/dist/search.mjs +9 -12
- package/dist/search.mjs.map +1 -1
- package/dist/store.d.mts +92 -29
- package/dist/store.d.mts.map +1 -1
- package/dist/store.mjs +3 -3
- package/dist/store.mjs.map +1 -1
- package/dist/summarization.d.mts +6 -9
- package/dist/summarization.d.mts.map +1 -1
- package/dist/summarization.mjs +1 -2
- package/dist/summarization.mjs.map +1 -1
- package/package.json +11 -41
- package/src/agent.ts +393 -65
- package/src/chunking.ts +27 -8
- package/src/context.ts +21 -16
- package/src/documents.ts +140 -71
- package/src/errors.ts +4 -4
- package/src/extraction.ts +4 -3
- package/src/files.ts +24 -0
- package/src/index.ts +6 -3
- package/src/ingestion.ts +46 -27
- package/src/search.ts +90 -62
- package/src/store.ts +139 -25
- package/src/summarization.ts +4 -3
- package/dist/artifacts.d.mts +0 -37
- package/dist/artifacts.d.mts.map +0 -1
- package/dist/artifacts.mjs +0 -28
- package/dist/artifacts.mjs.map +0 -1
- package/dist/links.d.mts +0 -17
- package/dist/links.d.mts.map +0 -1
- package/dist/links.mjs +0 -24
- package/dist/links.mjs.map +0 -1
- package/dist/provenance.d.mts +0 -20
- package/dist/provenance.d.mts.map +0 -1
- package/dist/provenance.mjs +0 -26
- package/dist/provenance.mjs.map +0 -1
- package/dist/records.d.mts +0 -59
- package/dist/records.d.mts.map +0 -1
- package/dist/records.mjs +0 -64
- package/dist/records.mjs.map +0 -1
- package/dist/representations.d.mts +0 -36
- package/dist/representations.d.mts.map +0 -1
- package/dist/representations.mjs +0 -44
- package/dist/representations.mjs.map +0 -1
- package/dist/search-store.d.mts +0 -77
- package/dist/search-store.d.mts.map +0 -1
- package/dist/search-store.mjs +0 -7
- package/dist/search-store.mjs.map +0 -1
- package/dist/vector-store.d.mts +0 -3
- package/dist/vector-store.mjs +0 -2
- package/src/artifacts.ts +0 -48
- package/src/links.ts +0 -23
- package/src/provenance.ts +0 -25
- package/src/records.ts +0 -76
- package/src/representations.ts +0 -51
- package/src/search-store.ts +0 -98
- package/src/vector-store.ts +0 -6
package/src/search-store.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Context } from 'effect'
|
|
2
|
-
import type { Effect } from 'effect'
|
|
3
|
-
import type { KnowledgeChunk, KnowledgeDocument, KnowledgeSearchScope, KnowledgeCollection } from './documents.ts'
|
|
4
|
-
import type { KnowledgeEmbedding } from './embeddings.ts'
|
|
5
|
-
import type { SearchIndexStoreError } from './errors.ts'
|
|
6
|
-
|
|
7
|
-
export type UpsertKnowledgeDocumentInput = {
|
|
8
|
-
readonly document: KnowledgeDocument
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type ReplaceKnowledgeDocumentChunksInput = {
|
|
12
|
-
readonly collectionId: string
|
|
13
|
-
readonly documentId: string
|
|
14
|
-
readonly chunks: ReadonlyArray<{
|
|
15
|
-
readonly chunk: KnowledgeChunk
|
|
16
|
-
readonly embedding: KnowledgeEmbedding
|
|
17
|
-
}>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type MarkKnowledgeDocumentReadyInput = {
|
|
21
|
-
readonly collectionId: string
|
|
22
|
-
readonly documentId: string
|
|
23
|
-
readonly title?: string
|
|
24
|
-
readonly summary?: string
|
|
25
|
-
readonly contentHash?: string
|
|
26
|
-
readonly tokenCount: number
|
|
27
|
-
readonly chunkCount: number
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type MarkKnowledgeDocumentErrorInput = {
|
|
31
|
-
readonly collectionId: string
|
|
32
|
-
readonly documentId: string
|
|
33
|
-
readonly message: string
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type KnowledgeChunkSearchInput = {
|
|
37
|
-
readonly scope: KnowledgeSearchScope
|
|
38
|
-
readonly embedding: KnowledgeEmbedding
|
|
39
|
-
readonly limit: number
|
|
40
|
-
readonly minScore?: number
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type KnowledgeChunkTextSearchInput = {
|
|
44
|
-
readonly scope: KnowledgeSearchScope
|
|
45
|
-
readonly query: string
|
|
46
|
-
readonly limit: number
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type KnowledgeChunkSearchResult = {
|
|
50
|
-
readonly chunk: KnowledgeChunk
|
|
51
|
-
readonly score: number
|
|
52
|
-
readonly document: KnowledgeDocument
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type KnowledgeSearchContextChunksInput = {
|
|
56
|
-
readonly collectionId: string
|
|
57
|
-
readonly documentId: string
|
|
58
|
-
readonly position: number
|
|
59
|
-
readonly contextChunks: number
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type SearchIndexStoreApi = {
|
|
63
|
-
readonly upsertSet: (set: KnowledgeCollection) => Effect.Effect<KnowledgeCollection, SearchIndexStoreError>
|
|
64
|
-
readonly getSet: (id: string) => Effect.Effect<KnowledgeCollection, SearchIndexStoreError>
|
|
65
|
-
readonly upsertDocument: (
|
|
66
|
-
input: UpsertKnowledgeDocumentInput
|
|
67
|
-
) => Effect.Effect<KnowledgeDocument, SearchIndexStoreError>
|
|
68
|
-
readonly markDocumentProcessing: (input: {
|
|
69
|
-
readonly collectionId: string
|
|
70
|
-
readonly documentId: string
|
|
71
|
-
}) => Effect.Effect<KnowledgeDocument, SearchIndexStoreError>
|
|
72
|
-
readonly replaceDocumentChunks: (
|
|
73
|
-
input: ReplaceKnowledgeDocumentChunksInput
|
|
74
|
-
) => Effect.Effect<void, SearchIndexStoreError>
|
|
75
|
-
readonly markDocumentReady: (
|
|
76
|
-
input: MarkKnowledgeDocumentReadyInput
|
|
77
|
-
) => Effect.Effect<KnowledgeDocument, SearchIndexStoreError>
|
|
78
|
-
readonly markDocumentError: (
|
|
79
|
-
input: MarkKnowledgeDocumentErrorInput
|
|
80
|
-
) => Effect.Effect<void, SearchIndexStoreError>
|
|
81
|
-
readonly deleteDocument: (input: {
|
|
82
|
-
readonly collectionId: string
|
|
83
|
-
readonly documentId: string
|
|
84
|
-
}) => Effect.Effect<void, SearchIndexStoreError>
|
|
85
|
-
readonly searchChunks: (
|
|
86
|
-
input: KnowledgeChunkSearchInput
|
|
87
|
-
) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>
|
|
88
|
-
readonly searchChunksByText: (
|
|
89
|
-
input: KnowledgeChunkTextSearchInput
|
|
90
|
-
) => Effect.Effect<ReadonlyArray<KnowledgeChunkSearchResult>, SearchIndexStoreError>
|
|
91
|
-
readonly getContextChunks: (
|
|
92
|
-
input: KnowledgeSearchContextChunksInput
|
|
93
|
-
) => Effect.Effect<ReadonlyArray<KnowledgeChunk>, SearchIndexStoreError>
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export class SearchIndexStore extends Context.Service<SearchIndexStore, SearchIndexStoreApi>()(
|
|
97
|
-
'@yolk-sdk/knowledge/SearchIndexStore'
|
|
98
|
-
) {}
|
package/src/vector-store.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { SearchIndexStoreError as VectorStoreError } from './errors.ts'
|
|
2
|
-
export type {
|
|
3
|
-
KnowledgeChunkSearchInput as VectorSearchQuery,
|
|
4
|
-
KnowledgeChunkSearchResult as VectorSearchResult,
|
|
5
|
-
ReplaceKnowledgeDocumentChunksInput as VectorRecord
|
|
6
|
-
} from './search-store.ts'
|