Assistant Agent
HomebrewedConversation and planning agent. hear_prompt classifies dish names only; after confirm, develop_plan seeds catalog and public Neo4j onto the plan, fills open slots via the Researcher, then drafts summary and directions.
OpenAI Agents SDK · Neo4j · SQLite queue · FastAPI
Overview
Layers 1–3 and 5 on the Mental Model. The Assistant owns chat and the plan. hear_prompt has no tools — dish name only, short confirm, or refuse. After the prompt is saved, develop_plan (same harness in agents_run.py, driven by worker.py) seeds catalog and public recipes onto the Plan, fills open slots via the Researcher, then drafts summary, advice, and directions.
Behavior
- Dish names only in chat. Non-dish prompts are answered in chat and not saved.
- Confirm before side effects. Nothing is queued or researched from
hear_prompt. - SQLite capture queue. Confirm enqueues a server job (
queue.db); the worker claims it, retries on failure, and clears the row after Neo4j save. - Seed, then fill. Catalog favorites first, then public Neo4j matches not already offered this session; each is linked onto the plan immediately. Target is three recipes. Researcher scrapes only remaining slots.
- Orchestrator-Worker. Researcher hands scraped pages onto the plan as they are accepted; Assistant compiles the draft. See Building effective agents.
- Keep stored directions. Catalog and public matches keep their stored directions and nutrition. No
analyze_recipetool on this path.
Plan flow
One confirmed dish through the SQLite capture queue, then the worker. Diagram key: ✦ AI agent · second line = Anthropic workflow · purple = actor · white = service.
---
config:
theme: default
themeVariables:
background: "#ffffff"
fontSize: "14px"
---
flowchart TB
person[Person]
chat["✦ Assistant hear prompt
Prompt Chaining"]
queue[SQLite capture queue]
worker[Worker]
plan["✦ Assistant develop plan
Orchestrator-Worker"]
fav[Catalog favorites]
pub[Public Neo4j]
specialist["✦ fill open slots"]
neo[Neo4j Plan]
person -->|POST api listen| chat
chat -->|yes enqueue capture| queue --> worker --> plan
plan --> fav
plan --> pub
plan -->|remaining| specialist
plan --> neo
classDef agent fill:#e8f0ee,stroke:#0f3d36,stroke-width:2px,color:#0d0d0d
classDef service fill:#fafaf8,stroke:#c8c8c2,stroke-width:1px,color:#0d0d0d
classDef actor fill:#f3eef8,stroke:#6b4f9a,stroke-width:2px,color:#0d0d0d
class chat,plan,specialist agent
class queue,worker,fav,pub,neo service
class person actor
Prompt: assistant_agent.md. Chat: POST /api/listen. Capture queue → worker → develop_plan. Retoast re-enters at the worker and leaves prior plan recipes out.
Confirm-before-side-effects is the rule. Layer map on Mental Model; specialist research on Researcher. Part of Project.