#Goal
Teach a persistent agent one global convention and one repeatable procedure while keeping both separate from source truth.
#Store Global Guidance
from daita import Agent
async with await Agent.open("finance") as agent:
await agent.set_memory(
"Use net revenue as the default revenue measure. "
"State the reporting currency in every financial summary."
)
await agent.save_skill(
"variance-review",
"Explain material period-over-period changes in a financial metric.",
"""1. Confirm the metric and both periods.
2. Use the active reviewed metric definition.
3. Calculate the total change and percentage change.
4. Break the change down by region.
5. Highlight contributions greater than 10 percent.
6. State source, currency, period, and query limitations.""",
)
result = await agent.run(
"Use the variance-review skill to compare this quarter's revenue "
"with the prior quarter.",
source_id="source-id",
)
print(result.final_text)Memory is bounded advisory context. If “net revenue” has a precise definition tied to catalog fields, store that definition as a resource-scoped semantic annotation instead.
#Store a Procedure
The example stores the procedure with save_skill(). Only the skill name and description enter the base context; the model loads the procedure body through skill_view when it is relevant.
#Use the Skill
The final run() requests the skill explicitly. Replace source-id with one of the agent's active source IDs.
In interactive chat, you can invoke a stored skill directly:
/variance-review Compare this quarter's revenue with the prior quarter.#Inspect and Maintain
Reopen the agent and use read_memory(), list_skills(), and read_skill() to inspect the stored material.
Direct Python changes are explicit caller operations. If the model proposes a memory_set, skill_save, or skill_delete during a run, Daita requires the configured approval handler before writing local state.
See Memory, Skills, and Reviewed Learning.