praisonai Wrapper Compatibility Imports
praisonai.knowledge, praisonai.memory, and praisonai.eval still work as alias_package shims for older tutorials and PraisonAI University code
praisonai.knowledge, praisonai.memory, and praisonai.eval are compatibility import paths — they forward to praisonaiagents.* through alias_package shims, so older code and tutorials keep working with no change.
from praisonaiagents import Agent
from praisonai.eval import Judge # legacy import path still works
agent = Agent(name="Writer", instructions="Write one short, friendly sentence.")
output = agent.start("Describe Python in one sentence.")
result = Judge(criteria="Clear and friendly").run(output=output)
print(result.score, result.passed)Quick Start
- Old code keeps working
python from praisonai.knowledge import Knowledge from praisonai.memory import FileMemory from praisonai.eval import Judge - Prefer the canonical path for new code
python from praisonaiagents.knowledge import Knowledge from praisonaiagents.memory import FileMemory from praisonaiagents.eval import Judge - Classes are the same object
python from praisonai.knowledge import Knowledge as A from praisonaiagents.knowledge import Knowledge as B assert A is B # True — the shim preserves identity
Import Mapping
| Legacy wrapper path | Canonical path | Status |
|---|---|---|
praisonai.knowledge | praisonaiagents.knowledge | Shim — forwards; identity preserved |
praisonai.knowledge.* (e.g. Knowledge, KeywordIndex) | praisonaiagents.knowledge.* | Same object |
praisonai.memory | praisonaiagents.memory | Shim — forwards; identity preserved |
praisonai.memory.adapters | praisonaiagents.memory.adapters | Shim — submodule identity preserved |
praisonai.eval | praisonaiagents.eval | Shim — forwards; identity preserved |
Best Practices
Use praisonaiagents.* in new code
It is the canonical path — the SDK reference and new tutorials use it.
Don't rewrite working praisonai.* imports
They are a stable compatibility surface backed by alias_package shims and will keep working, just like the praisonai.bots / praisonai.gateway / praisonai.daemon shims.
Keep mock.patch targets consistent
Submodules are the same object under both paths, so patching a submodule attribute (e.g. praisonai.memory.adapters.SqliteMemoryAdapter) applies everywhere. The top-level praisonai.memory package is a separate shim that forwards attribute reads, so patch top-level names on praisonaiagents.memory instead. See alias_package shim: lazy vs eager.