prismrag-patch 0.1.1__tar.gz → 0.1.2__tar.gz
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.
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/PKG-INFO +51 -39
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/README.md +50 -38
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch.egg-info/PKG-INFO +51 -39
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/pyproject.toml +1 -1
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/__init__.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/adapters/__init__.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/adapters/chroma.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/adapters/pgvector.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/adapters/pinecone.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/adapters/weaviate.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/core.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch/license.py +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch.egg-info/SOURCES.txt +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch.egg-info/dependency_links.txt +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch.egg-info/requires.txt +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/prismrag_patch.egg-info/top_level.txt +0 -0
- {prismrag_patch-0.1.1 → prismrag_patch-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prismrag-patch
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Drop-in hallucination-resistant retrieval for pgvector, ChromaDB, Pinecone, and Weaviate
|
|
5
5
|
Author-email: Insight IT Solutions <prismrag@insightits.com>
|
|
6
6
|
License: Commercial
|
|
@@ -45,46 +45,55 @@ PrismRAG Patch wraps pgvector, ChromaDB, Pinecone, or Weaviate with PrismRAG's
|
|
|
45
45
|
Tier-1 re-mapping technique — deterministic category projection that grounds every
|
|
46
46
|
chunk in your verified taxonomy before it ever reaches the LLM.
|
|
47
47
|
|
|
48
|
+
Works with **any embedding model** — Gemini, OpenAI, Cohere, HuggingFace, or your
|
|
49
|
+
own local model. No lock-in.
|
|
50
|
+
|
|
48
51
|
## Requirements
|
|
49
52
|
|
|
50
53
|
| Requirement | Detail |
|
|
51
54
|
|-------------|--------|
|
|
52
55
|
| Python | 3.10+ |
|
|
53
56
|
| License key | `prlib_` key from [prismrag.insightits.com](https://prismrag.insightits.com/prismrag-lib.html) |
|
|
54
|
-
| Embedding model |
|
|
55
|
-
| Gemini API key | Required if using Gemini embeddings — get one at [aistudio.google.com](https://aistudio.google.com) |
|
|
57
|
+
| Embedding model | Any model that returns a list of floats — you provide the vector |
|
|
56
58
|
|
|
57
|
-
> **
|
|
58
|
-
>
|
|
59
|
-
>
|
|
59
|
+
> **prismrag-patch does not generate embeddings.** You call your embedding model
|
|
60
|
+
> of choice, then pass the resulting vector to the adapter. The library remaps,
|
|
61
|
+
> enriches, and stores/searches it in your database.
|
|
60
62
|
|
|
61
|
-
## Quick start
|
|
63
|
+
## Quick start
|
|
62
64
|
|
|
63
65
|
```python
|
|
64
|
-
import os
|
|
65
|
-
import requests
|
|
66
|
-
import psycopg2
|
|
67
66
|
from prismrag_patch import PrismRAGPatch
|
|
68
67
|
from prismrag_patch.adapters.pgvector import PgvectorAdapter
|
|
68
|
+
import psycopg2
|
|
69
|
+
|
|
70
|
+
# ── 1. Your embedding function — use any model ────────────────────────────────
|
|
69
71
|
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
+
# Option A: OpenAI
|
|
73
|
+
from openai import OpenAI
|
|
74
|
+
def embed(text):
|
|
75
|
+
return OpenAI().embeddings.create(
|
|
76
|
+
input=text, model="text-embedding-3-small"
|
|
77
|
+
).data[0].embedding # 1536-dim
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
# Option B: Gemini
|
|
80
|
+
import os, requests
|
|
81
|
+
def embed(text):
|
|
75
82
|
resp = requests.post(
|
|
76
|
-
|
|
77
|
-
f"gemini-embedding-001:batchEmbedContents?key={
|
|
78
|
-
json={"requests": [{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"outputDimensionality": 768,
|
|
82
|
-
"taskType": "RETRIEVAL_DOCUMENT",
|
|
83
|
-
}]},
|
|
83
|
+
"https://generativelanguage.googleapis.com/v1beta/models/"
|
|
84
|
+
f"gemini-embedding-001:batchEmbedContents?key={os.environ['GEMINI_API_KEY']}",
|
|
85
|
+
json={"requests": [{"model": "models/gemini-embedding-001",
|
|
86
|
+
"content": {"parts": [{"text": text}]},
|
|
87
|
+
"outputDimensionality": 768}]},
|
|
84
88
|
timeout=30,
|
|
85
89
|
)
|
|
86
|
-
resp.
|
|
87
|
-
|
|
90
|
+
return resp.json()["embeddings"][0]["values"] # 768-dim
|
|
91
|
+
|
|
92
|
+
# Option C: HuggingFace (local, no API key)
|
|
93
|
+
from sentence_transformers import SentenceTransformer
|
|
94
|
+
_model = SentenceTransformer("all-MiniLM-L6-v2")
|
|
95
|
+
def embed(text):
|
|
96
|
+
return _model.encode(text).tolist() # 384-dim
|
|
88
97
|
|
|
89
98
|
|
|
90
99
|
# ── 2. Define your category mapping ──────────────────────────────────────────
|
|
@@ -101,22 +110,20 @@ mapping = {
|
|
|
101
110
|
],
|
|
102
111
|
}
|
|
103
112
|
|
|
104
|
-
# ── 3. Initialize
|
|
105
|
-
patch
|
|
106
|
-
|
|
107
|
-
# ── 4. Connect to your database ───────────────────────────────────────────────
|
|
113
|
+
# ── 3. Initialize and connect ─────────────────────────────────────────────────
|
|
114
|
+
patch = PrismRAGPatch(license_key="prlib_YOUR_KEY_HERE", mapping=mapping)
|
|
108
115
|
conn = psycopg2.connect("postgresql://user:pass@localhost:5432/mydb")
|
|
109
116
|
adapter = PgvectorAdapter(patch, conn, table="my_chunks")
|
|
110
|
-
adapter.ensure_table(dim=768) #
|
|
117
|
+
adapter.ensure_table(dim=768) # match your model's output dimension
|
|
111
118
|
|
|
112
|
-
# ──
|
|
113
|
-
doc
|
|
114
|
-
vec
|
|
119
|
+
# ── 4. Embed with your model, insert with prismrag-patch ─────────────────────
|
|
120
|
+
doc = "Market volatility spiked due to fraud risk exposure."
|
|
121
|
+
vec = embed(doc) # your model produces the vector
|
|
115
122
|
row_id = adapter.insert(doc, vec, metadata={"source": "risk_report"})
|
|
116
123
|
# stored vector is remapped toward "risk" category cluster
|
|
117
124
|
# metadata gets prismrag_category + prismrag_label injected automatically
|
|
118
125
|
|
|
119
|
-
# ──
|
|
126
|
+
# ── 5. Search ─────────────────────────────────────────────────────────────────
|
|
120
127
|
query = "what is our risk exposure?"
|
|
121
128
|
query_vec = embed(query)
|
|
122
129
|
results = adapter.search(query, query_vec, top_k=5)
|
|
@@ -165,7 +172,7 @@ adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
|
165
172
|
from pinecone import Pinecone
|
|
166
173
|
from prismrag_patch.adapters.pinecone import PineconeAdapter
|
|
167
174
|
|
|
168
|
-
pc = Pinecone(api_key=
|
|
175
|
+
pc = Pinecone(api_key="YOUR_PINECONE_KEY")
|
|
169
176
|
index = pc.Index("my-index")
|
|
170
177
|
adapter = PineconeAdapter(patch, index, namespace="finance")
|
|
171
178
|
adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
@@ -189,7 +196,7 @@ adapter.insert(doc, embed(doc))
|
|
|
189
196
|
Your text
|
|
190
197
|
│
|
|
191
198
|
▼
|
|
192
|
-
|
|
199
|
+
Any embedding model (OpenAI / Gemini / HuggingFace / Cohere / your own)
|
|
193
200
|
│
|
|
194
201
|
▼
|
|
195
202
|
raw vector [0.12, -0.45, 0.88, ...] N dimensions
|
|
@@ -207,14 +214,19 @@ stored in YOUR database — prismrag-patch never holds your data
|
|
|
207
214
|
|
|
208
215
|
## What prismrag-patch does NOT do
|
|
209
216
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
217
|
+
- Generate embeddings — you bring your own model
|
|
218
|
+
- Call an LLM
|
|
219
|
+
- Store your data on PrismRAG servers
|
|
220
|
+
- Lock you into any embedding provider
|
|
221
|
+
|
|
222
|
+
The only network call is a one-time license validation (cached 23 hours,
|
|
223
|
+
7-day offline grace period).
|
|
214
224
|
|
|
215
225
|
## License
|
|
216
226
|
|
|
217
227
|
Commercial license required. Get yours at
|
|
218
228
|
[prismrag.insightits.com/prismrag-lib.html](https://prismrag.insightits.com/prismrag-lib.html).
|
|
219
229
|
|
|
230
|
+
Questions? [prismrag@insightits.com](mailto:prismrag@insightits.com)
|
|
231
|
+
|
|
220
232
|
© 2026 Insight IT Solutions
|
|
@@ -6,46 +6,55 @@ PrismRAG Patch wraps pgvector, ChromaDB, Pinecone, or Weaviate with PrismRAG's
|
|
|
6
6
|
Tier-1 re-mapping technique — deterministic category projection that grounds every
|
|
7
7
|
chunk in your verified taxonomy before it ever reaches the LLM.
|
|
8
8
|
|
|
9
|
+
Works with **any embedding model** — Gemini, OpenAI, Cohere, HuggingFace, or your
|
|
10
|
+
own local model. No lock-in.
|
|
11
|
+
|
|
9
12
|
## Requirements
|
|
10
13
|
|
|
11
14
|
| Requirement | Detail |
|
|
12
15
|
|-------------|--------|
|
|
13
16
|
| Python | 3.10+ |
|
|
14
17
|
| License key | `prlib_` key from [prismrag.insightits.com](https://prismrag.insightits.com/prismrag-lib.html) |
|
|
15
|
-
| Embedding model |
|
|
16
|
-
| Gemini API key | Required if using Gemini embeddings — get one at [aistudio.google.com](https://aistudio.google.com) |
|
|
18
|
+
| Embedding model | Any model that returns a list of floats — you provide the vector |
|
|
17
19
|
|
|
18
|
-
> **
|
|
19
|
-
>
|
|
20
|
-
>
|
|
20
|
+
> **prismrag-patch does not generate embeddings.** You call your embedding model
|
|
21
|
+
> of choice, then pass the resulting vector to the adapter. The library remaps,
|
|
22
|
+
> enriches, and stores/searches it in your database.
|
|
21
23
|
|
|
22
|
-
## Quick start
|
|
24
|
+
## Quick start
|
|
23
25
|
|
|
24
26
|
```python
|
|
25
|
-
import os
|
|
26
|
-
import requests
|
|
27
|
-
import psycopg2
|
|
28
27
|
from prismrag_patch import PrismRAGPatch
|
|
29
28
|
from prismrag_patch.adapters.pgvector import PgvectorAdapter
|
|
29
|
+
import psycopg2
|
|
30
|
+
|
|
31
|
+
# ── 1. Your embedding function — use any model ────────────────────────────────
|
|
30
32
|
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
+
# Option A: OpenAI
|
|
34
|
+
from openai import OpenAI
|
|
35
|
+
def embed(text):
|
|
36
|
+
return OpenAI().embeddings.create(
|
|
37
|
+
input=text, model="text-embedding-3-small"
|
|
38
|
+
).data[0].embedding # 1536-dim
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
# Option B: Gemini
|
|
41
|
+
import os, requests
|
|
42
|
+
def embed(text):
|
|
36
43
|
resp = requests.post(
|
|
37
|
-
|
|
38
|
-
f"gemini-embedding-001:batchEmbedContents?key={
|
|
39
|
-
json={"requests": [{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"outputDimensionality": 768,
|
|
43
|
-
"taskType": "RETRIEVAL_DOCUMENT",
|
|
44
|
-
}]},
|
|
44
|
+
"https://generativelanguage.googleapis.com/v1beta/models/"
|
|
45
|
+
f"gemini-embedding-001:batchEmbedContents?key={os.environ['GEMINI_API_KEY']}",
|
|
46
|
+
json={"requests": [{"model": "models/gemini-embedding-001",
|
|
47
|
+
"content": {"parts": [{"text": text}]},
|
|
48
|
+
"outputDimensionality": 768}]},
|
|
45
49
|
timeout=30,
|
|
46
50
|
)
|
|
47
|
-
resp.
|
|
48
|
-
|
|
51
|
+
return resp.json()["embeddings"][0]["values"] # 768-dim
|
|
52
|
+
|
|
53
|
+
# Option C: HuggingFace (local, no API key)
|
|
54
|
+
from sentence_transformers import SentenceTransformer
|
|
55
|
+
_model = SentenceTransformer("all-MiniLM-L6-v2")
|
|
56
|
+
def embed(text):
|
|
57
|
+
return _model.encode(text).tolist() # 384-dim
|
|
49
58
|
|
|
50
59
|
|
|
51
60
|
# ── 2. Define your category mapping ──────────────────────────────────────────
|
|
@@ -62,22 +71,20 @@ mapping = {
|
|
|
62
71
|
],
|
|
63
72
|
}
|
|
64
73
|
|
|
65
|
-
# ── 3. Initialize
|
|
66
|
-
patch
|
|
67
|
-
|
|
68
|
-
# ── 4. Connect to your database ───────────────────────────────────────────────
|
|
74
|
+
# ── 3. Initialize and connect ─────────────────────────────────────────────────
|
|
75
|
+
patch = PrismRAGPatch(license_key="prlib_YOUR_KEY_HERE", mapping=mapping)
|
|
69
76
|
conn = psycopg2.connect("postgresql://user:pass@localhost:5432/mydb")
|
|
70
77
|
adapter = PgvectorAdapter(patch, conn, table="my_chunks")
|
|
71
|
-
adapter.ensure_table(dim=768) #
|
|
78
|
+
adapter.ensure_table(dim=768) # match your model's output dimension
|
|
72
79
|
|
|
73
|
-
# ──
|
|
74
|
-
doc
|
|
75
|
-
vec
|
|
80
|
+
# ── 4. Embed with your model, insert with prismrag-patch ─────────────────────
|
|
81
|
+
doc = "Market volatility spiked due to fraud risk exposure."
|
|
82
|
+
vec = embed(doc) # your model produces the vector
|
|
76
83
|
row_id = adapter.insert(doc, vec, metadata={"source": "risk_report"})
|
|
77
84
|
# stored vector is remapped toward "risk" category cluster
|
|
78
85
|
# metadata gets prismrag_category + prismrag_label injected automatically
|
|
79
86
|
|
|
80
|
-
# ──
|
|
87
|
+
# ── 5. Search ─────────────────────────────────────────────────────────────────
|
|
81
88
|
query = "what is our risk exposure?"
|
|
82
89
|
query_vec = embed(query)
|
|
83
90
|
results = adapter.search(query, query_vec, top_k=5)
|
|
@@ -126,7 +133,7 @@ adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
|
126
133
|
from pinecone import Pinecone
|
|
127
134
|
from prismrag_patch.adapters.pinecone import PineconeAdapter
|
|
128
135
|
|
|
129
|
-
pc = Pinecone(api_key=
|
|
136
|
+
pc = Pinecone(api_key="YOUR_PINECONE_KEY")
|
|
130
137
|
index = pc.Index("my-index")
|
|
131
138
|
adapter = PineconeAdapter(patch, index, namespace="finance")
|
|
132
139
|
adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
@@ -150,7 +157,7 @@ adapter.insert(doc, embed(doc))
|
|
|
150
157
|
Your text
|
|
151
158
|
│
|
|
152
159
|
▼
|
|
153
|
-
|
|
160
|
+
Any embedding model (OpenAI / Gemini / HuggingFace / Cohere / your own)
|
|
154
161
|
│
|
|
155
162
|
▼
|
|
156
163
|
raw vector [0.12, -0.45, 0.88, ...] N dimensions
|
|
@@ -168,14 +175,19 @@ stored in YOUR database — prismrag-patch never holds your data
|
|
|
168
175
|
|
|
169
176
|
## What prismrag-patch does NOT do
|
|
170
177
|
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
178
|
+
- Generate embeddings — you bring your own model
|
|
179
|
+
- Call an LLM
|
|
180
|
+
- Store your data on PrismRAG servers
|
|
181
|
+
- Lock you into any embedding provider
|
|
182
|
+
|
|
183
|
+
The only network call is a one-time license validation (cached 23 hours,
|
|
184
|
+
7-day offline grace period).
|
|
175
185
|
|
|
176
186
|
## License
|
|
177
187
|
|
|
178
188
|
Commercial license required. Get yours at
|
|
179
189
|
[prismrag.insightits.com/prismrag-lib.html](https://prismrag.insightits.com/prismrag-lib.html).
|
|
180
190
|
|
|
191
|
+
Questions? [prismrag@insightits.com](mailto:prismrag@insightits.com)
|
|
192
|
+
|
|
181
193
|
© 2026 Insight IT Solutions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: prismrag-patch
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Drop-in hallucination-resistant retrieval for pgvector, ChromaDB, Pinecone, and Weaviate
|
|
5
5
|
Author-email: Insight IT Solutions <prismrag@insightits.com>
|
|
6
6
|
License: Commercial
|
|
@@ -45,46 +45,55 @@ PrismRAG Patch wraps pgvector, ChromaDB, Pinecone, or Weaviate with PrismRAG's
|
|
|
45
45
|
Tier-1 re-mapping technique — deterministic category projection that grounds every
|
|
46
46
|
chunk in your verified taxonomy before it ever reaches the LLM.
|
|
47
47
|
|
|
48
|
+
Works with **any embedding model** — Gemini, OpenAI, Cohere, HuggingFace, or your
|
|
49
|
+
own local model. No lock-in.
|
|
50
|
+
|
|
48
51
|
## Requirements
|
|
49
52
|
|
|
50
53
|
| Requirement | Detail |
|
|
51
54
|
|-------------|--------|
|
|
52
55
|
| Python | 3.10+ |
|
|
53
56
|
| License key | `prlib_` key from [prismrag.insightits.com](https://prismrag.insightits.com/prismrag-lib.html) |
|
|
54
|
-
| Embedding model |
|
|
55
|
-
| Gemini API key | Required if using Gemini embeddings — get one at [aistudio.google.com](https://aistudio.google.com) |
|
|
57
|
+
| Embedding model | Any model that returns a list of floats — you provide the vector |
|
|
56
58
|
|
|
57
|
-
> **
|
|
58
|
-
>
|
|
59
|
-
>
|
|
59
|
+
> **prismrag-patch does not generate embeddings.** You call your embedding model
|
|
60
|
+
> of choice, then pass the resulting vector to the adapter. The library remaps,
|
|
61
|
+
> enriches, and stores/searches it in your database.
|
|
60
62
|
|
|
61
|
-
## Quick start
|
|
63
|
+
## Quick start
|
|
62
64
|
|
|
63
65
|
```python
|
|
64
|
-
import os
|
|
65
|
-
import requests
|
|
66
|
-
import psycopg2
|
|
67
66
|
from prismrag_patch import PrismRAGPatch
|
|
68
67
|
from prismrag_patch.adapters.pgvector import PgvectorAdapter
|
|
68
|
+
import psycopg2
|
|
69
|
+
|
|
70
|
+
# ── 1. Your embedding function — use any model ────────────────────────────────
|
|
69
71
|
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
+
# Option A: OpenAI
|
|
73
|
+
from openai import OpenAI
|
|
74
|
+
def embed(text):
|
|
75
|
+
return OpenAI().embeddings.create(
|
|
76
|
+
input=text, model="text-embedding-3-small"
|
|
77
|
+
).data[0].embedding # 1536-dim
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
# Option B: Gemini
|
|
80
|
+
import os, requests
|
|
81
|
+
def embed(text):
|
|
75
82
|
resp = requests.post(
|
|
76
|
-
|
|
77
|
-
f"gemini-embedding-001:batchEmbedContents?key={
|
|
78
|
-
json={"requests": [{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"outputDimensionality": 768,
|
|
82
|
-
"taskType": "RETRIEVAL_DOCUMENT",
|
|
83
|
-
}]},
|
|
83
|
+
"https://generativelanguage.googleapis.com/v1beta/models/"
|
|
84
|
+
f"gemini-embedding-001:batchEmbedContents?key={os.environ['GEMINI_API_KEY']}",
|
|
85
|
+
json={"requests": [{"model": "models/gemini-embedding-001",
|
|
86
|
+
"content": {"parts": [{"text": text}]},
|
|
87
|
+
"outputDimensionality": 768}]},
|
|
84
88
|
timeout=30,
|
|
85
89
|
)
|
|
86
|
-
resp.
|
|
87
|
-
|
|
90
|
+
return resp.json()["embeddings"][0]["values"] # 768-dim
|
|
91
|
+
|
|
92
|
+
# Option C: HuggingFace (local, no API key)
|
|
93
|
+
from sentence_transformers import SentenceTransformer
|
|
94
|
+
_model = SentenceTransformer("all-MiniLM-L6-v2")
|
|
95
|
+
def embed(text):
|
|
96
|
+
return _model.encode(text).tolist() # 384-dim
|
|
88
97
|
|
|
89
98
|
|
|
90
99
|
# ── 2. Define your category mapping ──────────────────────────────────────────
|
|
@@ -101,22 +110,20 @@ mapping = {
|
|
|
101
110
|
],
|
|
102
111
|
}
|
|
103
112
|
|
|
104
|
-
# ── 3. Initialize
|
|
105
|
-
patch
|
|
106
|
-
|
|
107
|
-
# ── 4. Connect to your database ───────────────────────────────────────────────
|
|
113
|
+
# ── 3. Initialize and connect ─────────────────────────────────────────────────
|
|
114
|
+
patch = PrismRAGPatch(license_key="prlib_YOUR_KEY_HERE", mapping=mapping)
|
|
108
115
|
conn = psycopg2.connect("postgresql://user:pass@localhost:5432/mydb")
|
|
109
116
|
adapter = PgvectorAdapter(patch, conn, table="my_chunks")
|
|
110
|
-
adapter.ensure_table(dim=768) #
|
|
117
|
+
adapter.ensure_table(dim=768) # match your model's output dimension
|
|
111
118
|
|
|
112
|
-
# ──
|
|
113
|
-
doc
|
|
114
|
-
vec
|
|
119
|
+
# ── 4. Embed with your model, insert with prismrag-patch ─────────────────────
|
|
120
|
+
doc = "Market volatility spiked due to fraud risk exposure."
|
|
121
|
+
vec = embed(doc) # your model produces the vector
|
|
115
122
|
row_id = adapter.insert(doc, vec, metadata={"source": "risk_report"})
|
|
116
123
|
# stored vector is remapped toward "risk" category cluster
|
|
117
124
|
# metadata gets prismrag_category + prismrag_label injected automatically
|
|
118
125
|
|
|
119
|
-
# ──
|
|
126
|
+
# ── 5. Search ─────────────────────────────────────────────────────────────────
|
|
120
127
|
query = "what is our risk exposure?"
|
|
121
128
|
query_vec = embed(query)
|
|
122
129
|
results = adapter.search(query, query_vec, top_k=5)
|
|
@@ -165,7 +172,7 @@ adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
|
165
172
|
from pinecone import Pinecone
|
|
166
173
|
from prismrag_patch.adapters.pinecone import PineconeAdapter
|
|
167
174
|
|
|
168
|
-
pc = Pinecone(api_key=
|
|
175
|
+
pc = Pinecone(api_key="YOUR_PINECONE_KEY")
|
|
169
176
|
index = pc.Index("my-index")
|
|
170
177
|
adapter = PineconeAdapter(patch, index, namespace="finance")
|
|
171
178
|
adapter.insert(doc, embed(doc), metadata={"source": "report"})
|
|
@@ -189,7 +196,7 @@ adapter.insert(doc, embed(doc))
|
|
|
189
196
|
Your text
|
|
190
197
|
│
|
|
191
198
|
▼
|
|
192
|
-
|
|
199
|
+
Any embedding model (OpenAI / Gemini / HuggingFace / Cohere / your own)
|
|
193
200
|
│
|
|
194
201
|
▼
|
|
195
202
|
raw vector [0.12, -0.45, 0.88, ...] N dimensions
|
|
@@ -207,14 +214,19 @@ stored in YOUR database — prismrag-patch never holds your data
|
|
|
207
214
|
|
|
208
215
|
## What prismrag-patch does NOT do
|
|
209
216
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
217
|
+
- Generate embeddings — you bring your own model
|
|
218
|
+
- Call an LLM
|
|
219
|
+
- Store your data on PrismRAG servers
|
|
220
|
+
- Lock you into any embedding provider
|
|
221
|
+
|
|
222
|
+
The only network call is a one-time license validation (cached 23 hours,
|
|
223
|
+
7-day offline grace period).
|
|
214
224
|
|
|
215
225
|
## License
|
|
216
226
|
|
|
217
227
|
Commercial license required. Get yours at
|
|
218
228
|
[prismrag.insightits.com/prismrag-lib.html](https://prismrag.insightits.com/prismrag-lib.html).
|
|
219
229
|
|
|
230
|
+
Questions? [prismrag@insightits.com](mailto:prismrag@insightits.com)
|
|
231
|
+
|
|
220
232
|
© 2026 Insight IT Solutions
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "prismrag-patch"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Drop-in hallucination-resistant retrieval for pgvector, ChromaDB, Pinecone, and Weaviate"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Commercial" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|