Three checks

Name, password, boat

Check the name, the password, and a fact that belongs in the note.

The name comes from memory. The password was not saved. The boat colour comes from the note.

Example

from praisonai import KeywordIndex, FileMemory

index = KeywordIndex()
index.add_documents(["The secret colour of the boat is blue."])
memory = FileMemory(user_id="learner")
memory.add_long_term("The learner name is Nila.")
print("Name")
print(memory.search("name")[0]["item"]["content"])
print("Password")
print(memory.search("password") or "Not saved.")
print("Boat")
print(index.query("colour", top_k=1)[0]["text"])

Try it Yourself

Example explained

  • Name — A fact about the person.
  • Password — Not stored.
  • Boat — A line from the note, not from memory.

Reference: documentation