How daelon711/inbox-shield-monver works
Inbox Shield is a Flask email-screening and student-support application. Lecturers process read-only Gmail messages through a fixed filter → student lookup → FAQ drafting workflow, then review drafts without sending them; students use a separate public-document chatbot. The graph also shows retrieval, provider abstraction, validation and permission controls, and in-memory draft state. Relationships follow the README and shown source references; several UI and integration details are documented but their implementation was not sampled.
Main entry points: orchestrator.py Email orchestrator · server.py Flask routes · factory.py Provider factory · base.py LLM interface
Components 26
Web and users
- Flask routes
server.py - Lecturer page
templates/lecturer.html - Student chat page
templates/chat.html
Email workflow
- Read-only mail reader
app/mail/gmail_reader.py - Email orchestrator
app/orchestrator.py - Verified student lookup
app/agents/lookup/tools.py
Agents and models
- Email filter
app/agents/filter/agent.py - Student lookup agent
app/agents/lookup/agent.py - FAQ responder
app/agents/responder/agent.py - Support chatbot
app/agents/chatbot/agent.py - LLM interface
app/llm/base.py - Provider factory
app/llm/factory.py - Mock provider
app/llm/mock.py - Ollama provider
app/llm/ollama.py - Cyberlab placeholder
app/llm/cyberlab.py
Security controls
- Data contracts
app/security/schemas.py - Validation and release gates
app/security/guards.py - Role and tool policy
app/security/permissions.py - Security audit log
app/security/audit.py
Knowledge and state
- Document retrieval
app/rag/retriever.py - Course documents
data/knowledge.json - Student records
data/students.json - Draft store
app/services/data_store.py
Other components
- Lecturer
- Student
- Gmail IMAP
Connections 32
- Lecturer → Lecturer page: reviews inbox
README.md - Lecturer page → Flask routes: uses routes
README.md - Student → Student chat page: asks questions
README.md - Student chat page → Flask routes: uses chat API
README.md - Flask routes → Read-only mail reader: fetches mail
server.py - Read-only mail reader → Gmail IMAP: reads inbox
README.md - Flask routes → Email orchestrator: processes emails
server.py - Email orchestrator → Validation and release gates: validates inputs and outputs
app/orchestrator.py - Email orchestrator → Email filter: classifies email
app/orchestrator.py - Email orchestrator → Student lookup agent: proposes lookup
app/orchestrator.py - Email orchestrator → Verified student lookup: runs authorized lookup
app/orchestrator.py - Verified student lookup → Student records: checks student record
README.md - Email orchestrator → FAQ responder: drafts FAQ reply
app/orchestrator.py - Email orchestrator → Document retrieval: retrieves FAQ context
app/orchestrator.py - Document retrieval → Course documents: ranks documents
README.md - Email orchestrator → Role and tool policy: checks agent and tool access
app/orchestrator.py - Email orchestrator → Draft store: saves approved-tool draft
app/orchestrator.py - Flask routes → Draft store: loads and decides drafts
server.py - Flask routes → Role and tool policy: authorizes chat and documents
server.py - Flask routes → Document retrieval: retrieves chat context
server.py - Flask routes → Support chatbot: answers student
server.py - Email filter → LLM interface: generates classification
app/agents/filter/agent.py - Student lookup agent → LLM interface: generates proposal
app/agents/lookup/agent.py - FAQ responder → LLM interface: generates draft
app/agents/responder/agent.py - Support chatbot → LLM interface: generates answer
app/agents/chatbot/agent.py - Flask routes → Provider factory: creates provider
server.py - Provider factory → Mock provider: selects provider
app/llm/factory.py - Provider factory → Ollama provider: selects provider
app/llm/factory.py - Provider factory → Cyberlab placeholder: selects provider
app/llm/factory.py - Validation and release gates → Data contracts: validates contracts
app/security/guards.py - Flask routes → Security audit log: records route outcomes
server.py - Email orchestrator → Security audit log: records pipeline events
app/orchestrator.py