Personal & Consumer Use Cases Basics
8 concept-first examples for a tiny personal agent - 5 basic and 3 intermediate.
Search across all documentation pages
8 concept-first examples for a tiny personal agent - 5 basic and 3 intermediate.
You will model inbox triage, a chat-channel reply, approval for sends, and hard stop conditions. Code stays sketch-level so the use-case shape stays clear.
# Optional local env for later experiments (not required to learn the patterns)
python -m venv .venv && source .venv/bin/activate
pip install pydanticWrite a personal-agent goal as a checkable outcome.
Goal: Post a morning digest of (a) unread mail from VIP list and
(b) calendar events in the next 24 hours to my Telegram chat.
Stop when digest is posted or after 6 tool turns.Register tools with different risk levels.
from pydantic import BaseModel, Field
class ListUnreadArgs(BaseModel):
max_messages: int = Field(default=20, ge=1, le=50)
class DraftReplyArgs(BaseModel):
thread_id: str
body: str
class SendReplyArgs(BaseModel):
thread_id: str
body: str
approved: bool = False
# Read tools: list_unread, get_calendar_day
# Write tools: send_reply, create_event - only when approved is Trueapproved.Walk one turn sequence on paper or in logs.
User/schedule: "Morning digest"
→ list_unread(max_messages=20)
← [{from: boss, subject: "Budget"}, {from: newsletter, ...}]
→ get_calendar_day(date=today)
← [{10:00 Standup}, {15:00 Dentist}]
→ final: "VIP: Budget email. Today: Standup 10:00, Dentist 15:00."Treat chat as a delivery tool, not as the whole agent.
def post_chat(channel: str, text: str) -> dict:
# Platform SDK or webhook; return message id + ok flag
return {"ok": True, "channel": channel, "chars": len(text)}
# Observation for the model:
# {"ok": true, "channel": "telegram:personal", "chars": 180}Related: Chat-Integrated Agents
Personal agents wake often. Each wake needs a budget.
def run_personal_wake(goal: str, tools: dict, max_turns: int = 6) -> str:
state = {"goal": goal, "trace": []}
for turn in range(max_turns):
decision = decide(state, tools) # model call
if decision.done:
return decision.answer
obs = tools[decision.tool](**decision.args)
state["trace"].append({"turn": turn, "tool": decision.tool, "obs": obs})
return "stopped: max turns - partial digest not posted"Never auto-send on day one.
User: "Reply to budget email: I'll send numbers by Friday."
→ get_thread(thread_id=...)
← {body, participants}
→ draft_reply(...) # stores draft only
← {draft_id, preview}
→ final: "Draft ready. Reply APPROVE <draft_id> to send."
# Later message: APPROVE d_123
→ send_reply(thread_id=..., body=..., approved=True)Related: Email and Calendar Agents
Expired Google tokens are normal life, not edge cases.
def list_unread(max_messages: int = 20) -> dict:
try:
return {"messages": fetch_mail(max_messages)}
except AuthError:
return {
"error": "auth_expired",
"action_needed": "Reconnect mail OAuth in settings.",
}Store durable personal rules outside the raw chat log.
PREFS = {
"timezone": "America/Los_Angeles",
"quiet_hours": ["22:00", "07:00"],
"vip_senders": ["boss@example.com"],
"tone": "concise, no emojis",
}
# Inject a short prefs block into system context each wake.Related: Why Self-Hosting a Personal Agent Appeals to Privacy-Conscious Users
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026