Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ALwrity ALwrity WebsiteIntakeService generate site brief

From Leeroopedia
Knowledge Sources
Domains Onboarding, Web_Analysis, LLM
Last Updated 2026-10-24 00:00 GMT

Overview

Concrete tool for generating a structured website brief and Exa research-query map from minimal intake form data, provided by the ALwrity onboarding subsystem.

Description

The WebsiteIntakeService.generate_site_brief method takes the business intake form a user fills during onboarding step 3 (business name, summary, template type, primary offerings, competitor URLs, product assets) and calls llm_text_gen with the SITE_BRIEF_SCHEMA JSON schema to produce a structured site brief. The brief contains a site_brief (business name, tagline, template type, geo scope, offerings, audience), a content_plan (page list with required pages), an exa_query_map (neural search queries for content research), and quality_flags. When the LLM is unavailable, a fallback brief is generated from the raw intake data.

Usage

Import this service when:

  • The onboarding flow reaches step 3 and needs to turn intake input into a structured site brief.
  • The research pipeline needs an Exa query map derived from the user's business.
  • A fallback site brief is needed when LLM generation fails.

Code Reference

Source Location

  • Repository: ALwrity
  • File: backend/services/onboarding/website_intake_service.py (L130-285)

Signature

class WebsiteIntakeService:
    """Generate site briefs and Exa query maps from minimal intake inputs."""

    def generate_site_brief(
        self,
        intake: Dict[str, Any],
        user_id: Optional[str] = None,
    ) -> Dict[str, Any]:
        """
        Generate a structured site brief from intake form data.

        Args:
            intake: Business intake data (business_name, business_summary,
                    template_type, primary_offerings, competitor_urls,
                    product_asset_urls, product_asset_ids).
            user_id: Clerk user ID for LLM provider selection.

        Returns:
            Dict matching SITE_BRIEF_SCHEMA with keys: site_brief,
            content_plan, exa_query_map, quality_flags. On LLM failure,
            returns a fallback brief generated from the raw intake.
        """

Import

from services.onboarding.website_intake_service import WebsiteIntakeService

I/O Contract

Inputs

Name Type Required Description
intake Dict[str, Any] Yes Business intake form (business_name, business_summary, template_type, primary_offerings, competitor_urls, product_asset_urls)
user_id Optional[str] No Clerk user ID for LLM provider routing

Outputs

Name Type Description
return Dict[str, Any] site_brief, content_plan, exa_query_map, quality_flags matching SITE_BRIEF_SCHEMA

Usage Examples

Generating a site brief from intake

from services.onboarding.website_intake_service import WebsiteIntakeService

service = WebsiteIntakeService()
brief = service.generate_site_brief(
    intake={
        "business_name": "Acme Coffee",
        "business_summary": "Specialty coffee roaster in Portland.",
        "template_type": "blog",
        "primary_offerings": ["Whole bean subscription", "Cafe"],
        "competitor_urls": ["https://competitor1.com", "https://competitor2.com"],
    },
    user_id="clerk_user_123",
)

print(brief["site_brief"]["business_name"])   # "Acme Coffee"
print(brief["exa_query_map"]["queries"])       # Exa search queries

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment