🔴 Problem
Currently,
engine/rag_engine.py
performs a manual cosine similarity search using np.dot in a loop over Python lists. This is $O(N)$ and will cause significant latency as the legal PDF library grows. Furthermore, embeddings are stored only in memory, meaning every application restart triggers a full, expensive re-indexing process.
✅ Proposed Solution
FAISS Integration: Replace manual loops with faiss-cpu to enable sub-linear search time.
Persistence Layer: Implement index.save() and index.load() logic to store embeddings in vector_store/index.faiss.
Delta Indexing: Introduce a hash-based file scanner (SHA-256) for law_pdfs/. The system should only embed new or modified documents, skipping existing ones to save CPU/RAM on startup.
Assign this issue to me under the oscg
🔴 Problem$O(N)$ and will cause significant latency as the legal PDF library grows. Furthermore, embeddings are stored only in memory, meaning every application restart triggers a full, expensive re-indexing process.
Currently,
engine/rag_engine.py
performs a manual cosine similarity search using np.dot in a loop over Python lists. This is
✅ Proposed Solution
FAISS Integration: Replace manual loops with faiss-cpu to enable sub-linear search time.
Persistence Layer: Implement index.save() and index.load() logic to store embeddings in vector_store/index.faiss.
Delta Indexing: Introduce a hash-based file scanner (SHA-256) for law_pdfs/. The system should only embed new or modified documents, skipping existing ones to save CPU/RAM on startup.
Assign this issue to me under the oscg