Rajan Sharma commited on
Commit
3c323be
·
verified ·
1 Parent(s): 4d43747

Create rag.py

Browse files
Files changed (1) hide show
  1. rag.py +9 -0
rag.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ class RAGIndex:
2
+ def __init__(self):
3
+ self.docs=[]
4
+
5
+ def add(self,chunks):
6
+ self.docs.extend(chunks)
7
+
8
+ def retrieve(self,q,k=5):
9
+ return [(d,1.0) for d in self.docs[:k]]