@strav/rag 1.0.0-alpha.22 → 1.0.0-alpha.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strav/rag",
3
- "version": "1.0.0-alpha.22",
3
+ "version": "1.0.0-alpha.25",
4
4
  "description": "Strav RAG module — vector store abstraction, pgvector + in-memory drivers, chunking strategies. Composes with @strav/brain for embeddings and @strav/database for persistence.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -19,10 +19,10 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@strav/brain": "1.0.0-alpha.22",
23
- "@strav/cli": "1.0.0-alpha.22",
24
- "@strav/database": "1.0.0-alpha.22",
25
- "@strav/kernel": "1.0.0-alpha.22"
22
+ "@strav/brain": "1.0.0-alpha.25",
23
+ "@strav/cli": "1.0.0-alpha.25",
24
+ "@strav/database": "1.0.0-alpha.25",
25
+ "@strav/kernel": "1.0.0-alpha.25"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@types/bun": ">=1.3.14"
@@ -0,0 +1 @@
1
+ export { MemoryDriver } from './memory_driver.ts'
@@ -20,14 +20,14 @@
20
20
  * of vectors, painful past tens of thousands.
21
21
  */
22
22
 
23
- import { CollectionNotFoundError } from '../rag_error.ts'
23
+ import { CollectionNotFoundError } from '../../rag_error.ts'
24
24
  import type {
25
25
  QueryOptions,
26
26
  QueryResult,
27
27
  VectorDocument,
28
28
  VectorMatch,
29
- } from '../types.ts'
30
- import type { VectorStore } from '../vector_store.ts'
29
+ } from '../../types.ts'
30
+ import type { VectorStore } from '../../vector_store.ts'
31
31
 
32
32
  interface StoredDoc {
33
33
  id: string
@@ -0,0 +1 @@
1
+ export { PgvectorDriver, type PgvectorDriverOptions } from './pgvector_driver.ts'
@@ -33,16 +33,16 @@ import {
33
33
  type DatabaseExecutor,
34
34
  type PostgresDatabase,
35
35
  } from '@strav/database'
36
- import { VectorQueryError } from '../rag_error.ts'
37
- import { ragVectorSchema } from '../rag_vector_schema.ts'
36
+ import { VectorQueryError } from '../../rag_error.ts'
37
+ import { ragVectorSchema } from '../../vectors/rag_vector_schema.ts'
38
38
  import type {
39
39
  QueryOptions,
40
40
  QueryResult,
41
41
  StoreConfig,
42
42
  VectorDocument,
43
43
  VectorMatch,
44
- } from '../types.ts'
45
- import type { VectorStore } from '../vector_store.ts'
44
+ } from '../../types.ts'
45
+ import type { VectorStore } from '../../vector_store.ts'
46
46
 
47
47
  export interface PgvectorDriverOptions {
48
48
  /** PostgresDatabase instance — typically resolved from the container. */
package/src/index.ts CHANGED
@@ -11,15 +11,15 @@
11
11
  export { createChunker } from './chunking/chunker.ts'
12
12
  export { FixedSizeChunker } from './chunking/fixed_size_chunker.ts'
13
13
  export { RecursiveChunker } from './chunking/recursive_chunker.ts'
14
- export { MemoryDriver } from './drivers/memory_driver.ts'
14
+ export { MemoryDriver } from './drivers/memory/memory_driver.ts'
15
15
  export {
16
16
  PgvectorDriver,
17
17
  type PgvectorDriverOptions,
18
- } from './drivers/pgvector_driver.ts'
18
+ } from './drivers/pgvector/pgvector_driver.ts'
19
19
  export {
20
20
  applyRagVectorMigration,
21
21
  type ApplyRagVectorMigrationOptions,
22
- } from './migrations.ts'
22
+ } from './vectors/apply_rag_vector_migration.ts'
23
23
  export {
24
24
  CollectionNotFoundError,
25
25
  EmbeddingError,
@@ -38,7 +38,7 @@ export {
38
38
  RagList,
39
39
  } from './console/index.ts'
40
40
  export { RagProvider } from './rag_provider.ts'
41
- export { ragVectorSchema } from './rag_vector_schema.ts'
41
+ export { ragVectorSchema } from './vectors/rag_vector_schema.ts'
42
42
  export { retrievable } from './retrievable.ts'
43
43
  export type {
44
44
  Chunk,
@@ -30,8 +30,8 @@ import { BrainManager } from '@strav/brain'
30
30
  // biome-ignore lint/style/useImportType: Application value import for the container handle.
31
31
  import { Application, inject, ulid } from '@strav/kernel'
32
32
  import { createChunker } from './chunking/chunker.ts'
33
- import { MemoryDriver } from './drivers/memory_driver.ts'
34
- import { PgvectorDriver } from './drivers/pgvector_driver.ts'
33
+ import { MemoryDriver } from './drivers/memory/memory_driver.ts'
34
+ import { PgvectorDriver } from './drivers/pgvector/pgvector_driver.ts'
35
35
  import { EmbeddingError, RagError } from './rag_error.ts'
36
36
  import type {
37
37
  ChunkingConfig,
@@ -4,13 +4,12 @@
4
4
  * its collection without juggling `RagManager` calls by hand.
5
5
  *
6
6
  * ```ts
7
- * @inject()
8
7
  * export class ArticleRepository extends retrievable(Repository<Article>) {
9
8
  * static override readonly schema = articleSchema
10
9
  * static override readonly model = Article
11
10
  *
12
- * constructor(db: PostgresDatabase, events: EventBus, rag: RagManager) {
13
- * super(db, events)
11
+ * constructor(options: RepositoryOptions, rag: RagManager) {
12
+ * super(options)
14
13
  * this.rag = rag
15
14
  * }
16
15
  *