Knowledge

Note: If the sandbox prints a parser warning, the preview reply underneath is still the result of the run.

Save a note

Knowledge is a note the agent can read. These lines save one sentence and point the agent at that file.

write_text saves the sentence. knowledge is that file. Run prints the sentence. Searching it on your computer is the same line, and it is covered in the docs.

Example

from pathlib import Path
from praisonai import Agent

notes = Path("/tmp/praison-notes.txt")
notes.write_text("PraisonAI agents can read a note you saved.")
agent = Agent(
    name="Knowledge Agent",
    instructions="You answer questions based on the provided knowledge.",
    knowledge=[str(notes)],
)
print(notes.read_text())

Try it Yourself

Example explained

  • knowledge — A list of files. This example writes one, then reads it.

Reference: documentation