How raslmm/safebite works
SafeBite is a Streamlit app for checking packaged-food ingredient text against a user’s selected allergens. Users sign in, select or load an allergy profile, enter and review label text, then ask the agent to check it; the deterministic checker returns a risk assessment with evidence. Google model calls support the conversational interface, while MongoDB stores profiles and demo email accounts. The README also documents Google OIDC and a planned photo scanner; the scanner has no implemented runtime path. Edges reflect the excerpts, SOURCE INDEX references, or README; unsampled behavior is not inferred.
Main entry points: app.py Streamlit app · agent.py Agent turn · llm.py Google model adapter · tracing.py Request tracing
Components 18
User application
- Streamlit app
app.py - Reviewed label
app.py - Photo scanner (planned)
app.py
Identity and profiles
- Google OIDC
- Email account auth
safebite_agent/email_auth.py - Allergy profile store
safebite_agent/profile_store.py
Screening and agent
- Agent turn
safebite_agent/agent.py - Tool dispatch
safebite_agent/tools.py - Allergen checker
safebite_agent/allergen_checker.py - EU allergen reference
safebite_agent/allergen_reference.py - Typed contracts
safebite_agent/schemas.py
Model and observability
- Google model adapter
safebite_agent/llm.py - Runtime settings
safebite_agent/config.py - Request tracing
safebite_agent/tracing.py
Other components
- User
- MongoDB
- Google GenAI
- Langfuse
Connections 24
- User → Streamlit app: uses
README.md - Streamlit app → Email account auth: authenticates
app.py - Streamlit app → Google OIDC: signs in
README.md - Streamlit app → Allergy profile store: loads and saves
app.py - Email account auth → MongoDB: stores accounts
safebite_agent/email_auth.py - Allergy profile store → MongoDB: stores profiles
safebite_agent/profile_store.py - User → Reviewed label: enters text
app.py - Streamlit app → Reviewed label: saves reviewed text
app.py - Streamlit app → Agent turn: asks
app.py - Agent turn → Google model adapter: requests turn
safebite_agent/agent.py - Google model adapter → Google GenAI: calls
safebite_agent/llm.py - Google model adapter → Runtime settings: reads settings
safebite_agent/llm.py - Agent turn → Tool dispatch: dispatches calls
safebite_agent/agent.py - Tool dispatch → Allergen checker: checks label
safebite_agent/tools.py - Allergen checker → EU allergen reference: matches terms
safebite_agent/allergen_checker.py - Streamlit app → EU allergen reference: shows catalog
app.py - Streamlit app → Typed contracts: builds label data
app.py - Agent turn → Typed contracts: uses contracts
safebite_agent/agent.py - Streamlit app → Typed contracts: uses profile types
app.py - Google model adapter → Request tracing: records calls
safebite_agent/llm.py - Request tracing → Runtime settings: reads settings
safebite_agent/tracing.py - Request tracing → Langfuse: records traces
safebite_agent/tracing.py - Streamlit app → User: shows assessment
app.py - User → Photo scanner (planned): requests scan
README.md