Engineering

Planning documentation for the Your Solar Guy MVP.

Technical Architecture

Architecture overview

Your Solar Guy is planned around two entry paths: a private web workspace and verified email. Both paths use the same document processing, date rules, quality checks, private data, and outputs.

High-level Your Solar Guy architecture

The diagram shows the main responsibilities and trust boundaries. It leaves room for implementation choices while keeping the product rules clear.

Architecture principles

Major components

ComponentResponsibility
Web workspaceUpload, results, calendar actions, private access, and Q&A
Verified emailAttachment intake, follow-up questions, results, and calendar approval
Document Extraction AgentTurn manual pages into structured evidence
Email Evaluator AgentInterpret verified email conversations
RAG Q&A AgentAnswer questions from retrieved manual evidence
QA/QC AgentReview important extraction and delivery artifacts
Calendar AgentCalculate eligible dates and create calendar files
Shared private foundationStore documents, structured results, workflow state, citations, and approvals

Document and results flow

  1. Authorize the private workspace or verified email case.
  2. Validate and store each file.
  3. Divide long documents into bounded page work.
  4. Extract structured actions and evidence.
  5. Review extraction quality.
  6. Apply the optional installation baseline.
  7. Calculate supported dates and recurrence.
  8. Review and save results.
  9. Present the timeline, notes, condition-based actions, calendar options, and Q&A.

The Calendar Agent selects valid future dates, groups recurrence for display, and creates standard all-day events. Download and email delivery use the same eligible event set. Email approval is tied to the current result version.

Email coordination

A verified inbound event creates durable work. The service retrieves the message and allowed attachments, resolves the private conversation, and handles clear commands before language interpretation.

LangGraph coordinates conversation states. A case-scoped MCP boundary exposes only the capabilities needed by the Email Evaluator. Outbound messages pass through the applicable quality checks and leave through a durable email queue.

Manual Q&A

The first question prepares a reusable index for retained documents. Page-aware sections receive embeddings and remain tied to their document and page. Retrieval searches one authorized workspace, and answers may cite only the evidence selected for that question.

Trust and data boundaries

Private links provide workspace access without an account screen. The server validates workspace scope for every operation. Email identity depends on verified provider messages and signed conversation context. Public invitation forms reveal no existing workspace state.

Every document, result, question, approval, artifact, and job belongs to one workspace or verified email case. Models cannot choose the workspace, recipient, or authority. Manuals and email text are untrusted input, and provider credentials remain outside model context.

Reliability, limits, and deployment

Slow work uses durable jobs, leases, bounded retries, and duplicate protection. Completed stages are saved before the next stage begins. A temporary provider failure pauses at the affected stage.

AI access remains free-only. Rate limits preserve work, and no paid fallback is selected automatically.

The planned deployment uses Vercel for the web application, Supabase for private data and storage, Gemini for AI tasks, and Resend for email. Scheduled calls support background work and retention cleanup.

Tradeoffs

Related planning documents

Agent Orchestration describes role boundaries. Data Contracts describes information ownership. Engineering Constraints records limits. Testing and Acceptance defines release checks.