Knowledge

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

Point at a file

Knowledge is source material the agent can read, such as a file you already have.

knowledge takes a list of paths. The agent answers from those files.

Example

from praisonai import Agent

notes = "/tmp/notes.txt"
with open(notes, "w", encoding="utf-8") as handle:
    handle.write("PraisonAI agents can read a knowledge file.")

agent = Agent(
    name="Knowledge Agent",
    instructions="You answer questions based on the provided knowledge.",
    knowledge=[notes],
)
print(agent.start("What can agents read?"))

Try it Yourself

Example explained

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

Reference: documentation