Praison AI
Enterprise
Agents
Bot
Use Cases
University
Docs
Where the note is kept
Run
from praisonaiagents.knowledge import KeywordIndex, Knowledge lines = [ "Apples grow on trees in the orchard.", "The secret colour of the boat is blue.", "Tickets for the ferry cost four pounds.", ] index = KeywordIndex() index.add_documents(lines) kb = Knowledge(config={"vector_store": {"provider": "sqlite"}}) kb.add("The secret colour of the boat is blue.", user_id="learner") print("Script") print(index.query("What colour is the boat?", top_k=1)[0]["text"].strip()) print("SQLite") print(kb.search("colour", user_id="learner").results[0].text)
Press Run. The result appears here.
Esc
Search in
All
Docs
University