summaryrefslogtreecommitdiff
path: root/rag/db
diff options
context:
space:
mode:
Diffstat (limited to 'rag/db')
-rw-r--r--rag/db/embeddings.py (renamed from rag/db/vector.py)10
1 files changed, 5 insertions, 5 deletions
diff --git a/rag/db/vector.py b/rag/db/embeddings.py
index f229ba7..f9d0735 100644
--- a/rag/db/vector.py
+++ b/rag/db/embeddings.py
@@ -1,15 +1,15 @@
+import os
from typing import Tuple
+
import faiss
import numpy as np
-# TODO: read from .env
-EMBEDDING_DIM = 1024
-
# TODO: inner product distance metric?
-class VectorStore:
+class Embeddings:
def __init__(self):
- self.index = faiss.IndexFlatL2(EMBEDDING_DIM)
+ self.dim = os.environ["EMBEDDING_DIM"]
+ self.index = faiss.IndexFlatL2(self.dim)
# TODO: load from file
def add(self, embeddings: np.ndarray):