How sahil123goyal/drug_monitor_recall works
Drug Recall Monitor manages household medicine inventory, fetches official recall candidates, assesses identity evidence, pauses for human input and approval, then records mock alert delivery and verification. The main path runs through the durable LangGraph worker; a Streamlit client uses the HTTP API rather than the database. Separate branches support notice fetching, optional Groq extraction, scheduled runs, and official-case evaluation. Source excerpts expose only part of the workflow, so links for unsampled subsystems rely on README statements or are omitted where ownership is unclear.
Main entry points: graph.py Recall graph · routes.py FastAPI routes · views Streamlit pages · repository.py Workflow repository
Components 23
User interfaces
- Streamlit pages
frontend/views - UI shell
frontend/ui.py - Typed API client
frontend/api_client.py - Result presentation
frontend/presentation.py
Recall workflow
- FastAPI routes
app/api/routes.py - Durable run worker
app/services/run_worker.py - Graph runtime
app/agents/runtime.py - Recall graph
app/agents/graph.py - Workflow contracts
app/agents/contracts.py
Persistence and sources
- Workflow repository
app/agents/repository.py - PostgreSQL state
app/models/entities.py - Database sessions
app/db/session.py - OpenFDA adapter
app/sources/openfda.py - Notice store
app/services/notice_store.py
Assessment and verification
- Deterministic matcher
app/services/matcher.py - Groq extraction
app/services/extraction.py - Notice verification
app/services/verification.py
Operations and evaluation
- Run scheduler
app/services/scheduler.py - Official cases
app/services/official_cases.py - Official evaluator
app/services/official_runner.py - Evaluation service
app/services/evaluations.py - Settings
app/core/config.py
Other components
- Household user
Connections 24
- Household user → Streamlit pages: uses
README.md - Streamlit pages → UI shell: renders
frontend/views/approvals.py - UI shell → Typed API client: requests
frontend/ui.py - Typed API client → FastAPI routes: calls HTTP
frontend/api_client.py - FastAPI routes → Durable run worker: queues runs
README.md - Durable run worker → Graph runtime: runs workflow
app/services/run_worker.py - Graph runtime → Recall graph: builds
app/agents/runtime.py - Recall graph → Workflow contracts: uses state
app/agents/graph.py - Recall graph → Workflow repository: reads and writes
app/agents/graph.py - Workflow repository → PostgreSQL state: persists audit
app/agents/repository.py - Workflow repository → Database sessions: opens sessions
app/agents/runtime.py - Recall graph → OpenFDA adapter: fetches candidates
app/agents/graph.py - OpenFDA adapter → Notice store: persists pages
app/sources/openfda.py - Recall graph → Deterministic matcher: assesses notices
app/agents/graph.py - Deterministic matcher → Groq extraction: may use fields
app/services/matcher.py - Recall graph → Notice verification: verifies alerts
app/agents/graph.py - FastAPI routes → PostgreSQL state: serves inventory and runs
app/api/routes.py - Run scheduler → PostgreSQL state: schedules household runs
README.md - Run scheduler → Settings: reads schedule settings
app/core/config.py - Official evaluator → Official cases: loads cases
app/services/official_runner.py - Official evaluator → Recall graph: executes cases
app/services/official_runner.py - Evaluation service → Deterministic matcher: evaluates decisions
app/services/evaluations.py - FastAPI routes → Official evaluator: starts evaluations
app/api/routes.py - Streamlit pages → Result presentation: presents results
frontend/views/approvals.py