@denizsvnc/ai-rag-engine 2.2.0 → 2.2.1
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 +9 -2
- package/README.md +66 -14
- package/docs/RELEASING.md +1 -1
- package/docs/USAGE.md +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
This file follows Semantic Versioning.
|
|
3
|
+
This file follows Semantic Versioning.
|
|
4
4
|
|
|
5
|
-
## 2.2.
|
|
5
|
+
## 2.2.1 — 2026-11-10
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
- Updated `README.md`, `README_tr.md`, and `README_de.md` with verified, type-safe production examples featuring `GeminiAdapter`, `PostgresVectorAdapter`, `RedisCacheAdapter`, `LocalFaqAdapter`, and `SecurityConfig`.
|
|
10
|
+
- Removed legacy pre-publication disclaimers and streamlined installation documentation for live npm consumption.
|
|
11
|
+
|
|
12
|
+
## 2.2.0 — 2026-11-10
|
|
6
13
|
|
|
7
14
|
### Added
|
|
8
15
|
|
package/README.md
CHANGED
|
@@ -22,27 +22,14 @@
|
|
|
22
22
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
|
-
**Publication status:** prepared locally for `@denizsvnc/ai-rag-engine@2.2.0`; this is not a claim that it is already available on npm. Scope ownership and publication remain the maintainer's responsibility.
|
|
26
|
-
|
|
27
25
|
## Requirements and installation
|
|
28
26
|
|
|
29
27
|
ESM only. Node.js **22.14 or newer**; the compatibility matrix covers Node 22 and 24. TypeScript consumers should use TypeScript 5.8+ with NodeNext or Bundler resolution. Runtime applications do not need TypeScript or build tools.
|
|
30
28
|
|
|
31
|
-
After publication:
|
|
32
|
-
|
|
33
29
|
```sh
|
|
34
30
|
npm install @denizsvnc/ai-rag-engine
|
|
35
31
|
```
|
|
36
32
|
|
|
37
|
-
Before publication, install a locally built artifact:
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npm ci
|
|
41
|
-
npm pack
|
|
42
|
-
# From a different project:
|
|
43
|
-
npm install /absolute/path/to/denizsvnc-ai-rag-engine-2.2.0.tgz
|
|
44
|
-
```
|
|
45
|
-
|
|
46
33
|
## Quick Start
|
|
47
34
|
|
|
48
35
|
This deterministic example needs no credentials, model download, HTTP server, or database. The provider and vector adapter are test doubles demonstrating the integration contract; use real adapters for application data.
|
|
@@ -75,6 +62,71 @@ const result = await engine.query('What is the return window?', {
|
|
|
75
62
|
console.log(result.answer); // Returns: 14 days.
|
|
76
63
|
```
|
|
77
64
|
|
|
65
|
+
### Production Example (Multi-Tenant with Gemini, pgvector & Redis)
|
|
66
|
+
|
|
67
|
+
For production applications with external LLMs, multi-tenant persistence, and distributed caching:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import {
|
|
71
|
+
RAGEngine,
|
|
72
|
+
GeminiAdapter,
|
|
73
|
+
PostgresVectorAdapter,
|
|
74
|
+
RedisCacheAdapter,
|
|
75
|
+
LocalFaqAdapter
|
|
76
|
+
} from '@denizsvnc/ai-rag-engine';
|
|
77
|
+
|
|
78
|
+
const engine = new RAGEngine({
|
|
79
|
+
// 1. LLM Provider (Gemini, OpenAI, Ollama, or Custom)
|
|
80
|
+
llmProvider: new GeminiAdapter(
|
|
81
|
+
process.env.GEMINI_API_KEY,
|
|
82
|
+
'gemini-1.5-flash'
|
|
83
|
+
),
|
|
84
|
+
|
|
85
|
+
// 2. Knowledge Retrieval & Semantic FAQ Matching
|
|
86
|
+
inputs: {
|
|
87
|
+
vectorStore: new PostgresVectorAdapter({
|
|
88
|
+
connectionString: process.env.DATABASE_URL,
|
|
89
|
+
tableName: 'enterprise_embeddings'
|
|
90
|
+
}),
|
|
91
|
+
faq: new LocalFaqAdapter({
|
|
92
|
+
filePath: './faq.json',
|
|
93
|
+
defaultMatchThreshold: 0.65
|
|
94
|
+
})
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
// 3. Distributed Cache & Security Guardrails
|
|
98
|
+
cache: {
|
|
99
|
+
enabled: true,
|
|
100
|
+
adapter: new RedisCacheAdapter({
|
|
101
|
+
url: process.env.REDIS_URL,
|
|
102
|
+
defaultTtlMs: 3600000 // 1 hour
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
security: {
|
|
106
|
+
enabled: true,
|
|
107
|
+
blockHighRiskInjections: true,
|
|
108
|
+
pii: {
|
|
109
|
+
enabled: true,
|
|
110
|
+
maskTCKN: true,
|
|
111
|
+
maskCreditCards: true,
|
|
112
|
+
maskEmails: true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Query with tenant isolation & role-based access
|
|
118
|
+
const response = await engine.query('Q3 compliance audit summary', {
|
|
119
|
+
tenantId: 'tenant-acme',
|
|
120
|
+
userId: 'usr_8472',
|
|
121
|
+
roles: ['compliance_officer']
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
console.log(response.answer);
|
|
125
|
+
console.log('Intent:', response.intent);
|
|
126
|
+
console.log('Latency (ms):', response.latencyMs);
|
|
127
|
+
console.log('Sources:', response.sources);
|
|
128
|
+
```
|
|
129
|
+
|
|
78
130
|
Importing the SDK does not start a server, load `.env`, open Redis/PostgreSQL connections, download models, or change the Transformers global environment. Constructors and explicit initialization perform the operations described in [the usage guide](docs/USAGE.md).
|
|
79
131
|
|
|
80
132
|
## Capabilities and operational boundaries
|
|
@@ -96,7 +148,7 @@ Prompt filters and PII patterns are defenses with limitations, not guarantees of
|
|
|
96
148
|
- [Configuration, real providers, vectors, FAQ, tools and troubleshooting](docs/USAGE.md)
|
|
97
149
|
- [Versioning, manual publication and release checklist](docs/RELEASING.md)
|
|
98
150
|
- [Changelog](CHANGELOG.md)
|
|
99
|
-
- [Detailed
|
|
151
|
+
- [Detailed release-readiness report](docs/NPM_RELEASE_READINESS.md)
|
|
100
152
|
|
|
101
153
|
## Repository verification
|
|
102
154
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Policy
|
|
4
4
|
|
|
5
|
-
The recommended first public version is **2.2.0**: the repository already identifies its preceding API as 2.1.0, and the new distribution includes durable ingestion and persistence.
|
|
5
|
+
The recommended first public version is **2.2.0**: the repository already identifies its preceding API as 2.1.0, and the new distribution includes durable ingestion and persistence. Version **2.2.0** is the official initial release published on npm under `@denizsvnc/ai-rag-engine`.
|
|
6
6
|
|
|
7
7
|
After the first public release, use patch releases for compatible fixes, minor releases for compatible features, and major releases for incompatible public API, security-contract or supported-runtime changes. Document security-driven breaks and migration paths. Never reuse a published version; do not silently modify artifacts after review.
|
|
8
8
|
|
package/docs/USAGE.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Runtime and module contract
|
|
4
4
|
|
|
5
|
-
Install `@denizsvnc/ai-rag-engine`
|
|
5
|
+
Install `@denizsvnc/ai-rag-engine` from npm:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @denizsvnc/ai-rag-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use ESM (`"type": "module"` in the application). CommonJS `require()` is not a supported contract; CommonJS applications can use asynchronous `import()`. Node.js 22.14+ is required; Node 22/24 are the explicit test matrix. TypeScript 5.8+ is recommended; NodeNext and Bundler resolution are validated with strict checking. `skipLibCheck` is not required. Supported exports are the root API and `./package.json`; internal `dist/` paths are private. CLI commands are separate entry points.
|
|
6
12
|
|
|
7
13
|
The library never automatically loads `.env`. Applications may call `dotenv.config()` themselves. The server/worker/migration CLIs explicitly load `.env`. Importing the root library creates no server, connection, model download, or background worker. Native Transformers is imported lazily on the first embedding initialization.
|
|
8
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@denizsvnc/ai-rag-engine",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "TypeScript RAG engine with pluggable providers, local semantic routing, tenant-aware retrieval, and durable document ingestion.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|