Bayesian_LangChain / examples /quickstart.py
Angshul's picture
Upload 22 files
ce3f6c1 verified
Raw History Blame Contribute Delete
515 Bytes
from bayesian_langchain import BayesianIndex, BayesianRAG, DocumentRecord
docs = [
DocumentRecord("official", "The current HR portal is PeopleHub.", "Current policy", "official", {"reliability_alpha":18,"reliability_beta":2,"authority":0.98,"freshness":1.0}),
DocumentRecord("legacy", "The HR portal is WorkSphere.", "Legacy guide", "cache", {"reliability_alpha":6,"reliability_beta":6,"authority":0.45,"freshness":0.18}),
]
print(BayesianRAG(BayesianIndex(docs)).invoke("What is the current HR portal?"))