Praison AI
Enterprise
Agents
Bot
Use Cases
University
Docs
Answer from that section
Run
from praisonai import Agent from praisonaiagents.knowledge import KeywordIndex lines = [ "Apples grow on trees in the orchard.", "Tickets for the ferry cost four pounds.", ] index = KeywordIndex() index.add_documents(lines) question = "What colour is the boat?" section = index.query(question, top_k=1)[0]["text"] agent = Agent(instructions="Use only the Note. If colour is missing, answer unknown.") print(agent.start(question + "\nNote: " + section))
Press Run. The result appears here.
Esc
Search in
All
Docs
University