@vectororm/core 0.1.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/README.md +75 -0
- package/dist/index.d.mts +2493 -0
- package/dist/index.d.ts +2493 -0
- package/dist/index.js +2508 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2441 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @vectororm/core
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@vectororm/core)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
|
+
|
|
6
|
+
Core package for [Glyph VectorORM](https://github.com/aviramroi/VectorORM) — a TypeScript-first vector ORM with Vertical and Horizontal RAG.
|
|
7
|
+
|
|
8
|
+
Includes the abstract adapter base class, universal filter language, metadata builders, ingestion pipeline, enrichment pipeline, query composition layer, and the unified RAGClient facade.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vectororm/core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { RAGClient, MetadataBuilder, KeywordThemeClassifier } from '@vectororm/core';
|
|
20
|
+
import { ChromaAdapter } from '@vectororm/adapter-chroma';
|
|
21
|
+
|
|
22
|
+
// Create client with your adapter, embedder, and optional LLM
|
|
23
|
+
const client = new RAGClient({
|
|
24
|
+
adapter: new ChromaAdapter({ host: 'localhost', port: 8000 }),
|
|
25
|
+
embedder: myEmbedder,
|
|
26
|
+
llm: myLLM,
|
|
27
|
+
defaultCollection: 'docs'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Ingest documents
|
|
31
|
+
await client.createCollection('docs');
|
|
32
|
+
await client.ingest(['contracts/*.pdf'], 'docs');
|
|
33
|
+
|
|
34
|
+
// Enrich with themes
|
|
35
|
+
await client.enrich('docs', {
|
|
36
|
+
themes: {
|
|
37
|
+
themes: ['pricing', 'legal', 'technical'],
|
|
38
|
+
classifier: new KeywordThemeClassifier(
|
|
39
|
+
['pricing', 'legal', 'technical'],
|
|
40
|
+
{ pricing: ['cost', 'price', 'fee'], legal: ['liability', 'clause'], technical: ['api', 'sdk'] }
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Retrieve with filter shorthands
|
|
46
|
+
const result = await client.retrieve('pricing terms', {
|
|
47
|
+
partition: 'finance',
|
|
48
|
+
theme: 'pricing',
|
|
49
|
+
topK: 10
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Full RAG query
|
|
53
|
+
const response = await client.query('What are the pricing terms?');
|
|
54
|
+
console.log(response.answer);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## What's Included
|
|
58
|
+
|
|
59
|
+
- **VectorDBAdapter** — Abstract base class for database adapters
|
|
60
|
+
- **Embedder / LLMClient** — Abstract classes for embedding models and LLMs
|
|
61
|
+
- **Universal Filter Language** — Database-agnostic filter conditions (`eq`, `neq`, `in`, `gt`, `contains`, etc.)
|
|
62
|
+
- **MetadataBuilder** — Type-safe builder for vertical, horizontal, and structural metadata
|
|
63
|
+
- **Ingestion Pipeline** — Document loaders (Text, PDF, DOCX, HTML), chunkers (Recursive, Fixed, Sentence)
|
|
64
|
+
- **Enrichment Pipeline** — Keyword, zero-shot, embedding, and LLM-based classifiers
|
|
65
|
+
- **RAGQueryComposer** — Retrieval with grouped results (by document or theme)
|
|
66
|
+
- **RAGClient** — Unified facade for all operations
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- [API Guide](https://github.com/aviramroi/VectorORM/blob/main/docs/guide.md)
|
|
71
|
+
- [Full Project](https://github.com/aviramroi/VectorORM)
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
Apache-2.0
|