Files
praisonai-triage-agent[bot]andMervinPraison 9cef4eaa8e fix: derive generator memory backends from resolver; normalise runtime= (fixes #4229)
(a) The code generator advertised a hardcoded memory capability list that
still named removed backends (redis/postgres/qdrant), so generated agent
code raised before the API. Derive supports_presets/supports_url_schemes
from the live resolver registries (MEMORY_PRESETS, MEMORY_URL_SCHEMES) so
the generator can never teach a dead value. Update the four shipped
examples that crashed at the config boundary to use shipped backends.

(b) runtime= stored any string verbatim, silently dropping nine of twelve
capabilities on a typo. Normalise through canonical_runtime_name() so
spelling variants (NATIVE, " native ", Native) all map to the native
matrix, and raise on a close typo (nativ -> "Did you mean native?").
A genuinely unknown plugin runtime name is still accepted and falls back
to the reduced harness via the runtime registry, not a closed literal.

Co-authored-by: MervinPraison <[email protected]>
2026-08-23 04:55:43 +00:00

25 lines
616 B
Python

"""Basic memory example - minimal usage."""
from praisonaiagents import Agent
# Simple enable (uses default file-based memory)
agent = Agent(
instructions="You are a helpful assistant with memory.",
memory=True,
)
# With preset
agent_sqlite = Agent(
instructions="You are a helpful assistant.",
memory="sqlite", # Uses sqlite preset
)
# With URL
agent_mongo = Agent(
instructions="You are a helpful assistant.",
memory="mongodb://localhost/mydb", # URL auto-detected
)
if __name__ == "__main__":
response = agent.chat("Remember that my favorite color is blue.")
print(response)