> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weventures.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Expand AI

> Full-cycle automation for RFPs and proposal generation

<Note>
  **Your Primary Assignment**: Expand AI is built on the WorkAlly engine with specialized automation for proposals and 3D generation.
</Note>

## Overview

Expand AI provides full-cycle automation for RFPs and 2D/3D proposal generation, leveraging the WorkAlly intelligence engine.

<CardGroup cols={2}>
  <Card title="Proposal Generation" icon="file-lines">
    Automated content and 2D design creation
  </Card>

  <Card title="3D Module" icon="cube">
    Blender MCP orchestration for 3D assets
  </Card>

  <Card title="Opportunity Intel" icon="chart-line">
    Market intelligence and opportunity scoring
  </Card>

  <Card title="Financial Proposals" icon="calculator">
    Automated pricing and submission flows
  </Card>
</CardGroup>

## Tech Stack

<Tabs>
  <Tab title="Core">
    ```javascript theme={null}
    const expandStack = {
      frontend: "Next.js 14 App Router",
      styling: "Tailwind CSS + shadcn/ui",
      backend: "Supabase (Postgres, Auth, Storage)",
      ai: "LangChain + LangGraph",
      deployment: "Vercel + Supabase Edge Functions"
    }
    ```
  </Tab>

  <Tab title="AI Components">
    * **WorkAlly Engine**: Core intelligence layer
    * **LangChain**: Orchestration and tool calling
    * **LangGraph**: Complex workflow management
    * **Together AI**: Inference and fine-tuning
    * **Blender MCP**: 3D generation module
  </Tab>

  <Tab title="Infrastructure">
    * **CI/CD**: GitHub Actions
    * **Monitoring**: Sentry
    * **Analytics**: PostHog
    * **Storage**: Supabase Storage + S3
    * **CDN**: Cloudflare
  </Tab>
</Tabs>

## Key Features

### Proposal Generation

<Steps>
  <Step title="RFP Analysis">
    AI extracts requirements, scoring criteria, and submission guidelines
  </Step>

  <Step title="Content Generation">
    Creates tailored responses using company knowledge base
  </Step>

  <Step title="Design Assembly">
    Generates professional 2D layouts with branding
  </Step>

  <Step title="Review & Edit">
    Human-in-the-loop editing with AI suggestions
  </Step>

  <Step title="Submission">
    Automated formatting and submission workflows
  </Step>
</Steps>

### 3D Module Orchestration

<Accordion title="Capabilities">
  * Procedural 3D model generation
  * Texture and material application
  * Scene composition
  * Rendering pipelines
  * Asset optimization
</Accordion>

<Accordion title="Integration">
  ```typescript theme={null}
  // Example Blender MCP integration
  const generate3DAsset = async (prompt: string) => {
    const response = await blenderMCP.generate({
      prompt,
      style: "photorealistic",
      format: "glb",
      optimization: "web"
    })

    return response.assetUrl
  }
  ```
</Accordion>

## Development Guide

### Getting Started

<Steps>
  <Step title="Clone Repository">
    ```bash theme={null}
    git clone https://github.com/Weventures-AI/expand-ai.git
    cd expand-ai
    ```
  </Step>

  <Step title="Environment Setup">
    ```bash theme={null}
    cp .env.example .env.local
    # Add your Supabase and AI keys
    ```
  </Step>

  <Step title="Install Dependencies">
    ```bash theme={null}
    pnpm install
    pnpm dev
    ```
  </Step>

  <Step title="Read Driver Docs">
    Review `claude.md`, `plan.md`, and `agents.md`
  </Step>
</Steps>

### Working with AI Workflows

<CodeGroup>
  ```typescript Proposal Workflow theme={null}
  // app/api/proposals/generate/route.ts
  import { LangChain } from '@langchain/core'
  import { proposalChain } from '@/lib/chains'

  export async function POST(request: Request) {
    const { rfpContent, companyContext } = await request.json()

    const proposal = await proposalChain.invoke({
      rfp: rfpContent,
      context: companyContext,
      tools: ['research', 'write', 'format']
    })

    return Response.json(proposal)
  }
  ```

  ```typescript 3D Generation theme={null}
  // lib/3d/generator.ts
  import { BlenderMCP } from '@/lib/mcp'

  export async function generate3DScene(
    description: string,
    style: '2D' | '3D' | 'realistic'
  ) {
    const scene = await BlenderMCP.createScene({
      description,
      style,
      lighting: 'studio',
      camera: 'isometric'
    })

    return scene.export('glb')
  }
  ```
</CodeGroup>

### Database Schema

<Accordion title="Core Tables">
  ```sql theme={null}
  -- Proposals table
  CREATE TABLE proposals (
    id UUID PRIMARY KEY,
    rfp_id UUID REFERENCES rfps(id),
    content JSONB,
    status TEXT,
    created_at TIMESTAMPTZ
  );

  -- RFPs table
  CREATE TABLE rfps (
    id UUID PRIMARY KEY,
    title TEXT,
    requirements JSONB,
    deadline TIMESTAMPTZ,
    score_criteria JSONB
  );

  -- Assets table
  CREATE TABLE assets (
    id UUID PRIMARY KEY,
    proposal_id UUID REFERENCES proposals(id),
    type TEXT, -- '2d', '3d', 'document'
    url TEXT,
    metadata JSONB
  );
  ```
</Accordion>

## Current Milestones

<Tabs>
  <Tab title="Q1 2024">
    <Checklist>
      <Check>Core proposal generation engine</Check>
      <Check>RFP parsing and analysis</Check>
      <Check>Basic 2D layout generation</Check>
      <Check>User authentication flow</Check>
    </Checklist>
  </Tab>

  <Tab title="Q2 2024">
    <Checklist>
      <Check>3D module integration</Check>
      <Check>Advanced formatting options</Check>
      <Check>Team collaboration features</Check>
      <Check>API documentation</Check>
    </Checklist>
  </Tab>

  <Tab title="Current Sprint">
    * Implementing LangGraph workflows
    * Supabase RLS policies
    * Edge function optimization
    * Performance improvements
  </Tab>
</Tabs>

## Testing

<CodeGroup>
  ```bash Unit Tests theme={null}
  pnpm test           # Run all tests
  pnpm test:watch     # Watch mode
  pnpm test:coverage  # Coverage report
  ```

  ```bash E2E Tests theme={null}
  pnpm test:e2e       # Run Playwright tests
  pnpm test:e2e:ui    # Interactive mode
  ```

  ```bash AI Tests theme={null}
  pnpm test:ai        # Test AI workflows
  pnpm test:prompts   # Validate prompts
  ```
</CodeGroup>

## Deployment

### Environments

<CardGroup cols={3}>
  <Card title="Development" icon="code">
    Local development with hot reload
  </Card>

  <Card title="Staging" icon="flask">
    Preview deployments on Vercel
  </Card>

  <Card title="Production" icon="rocket">
    Production on custom domain
  </Card>
</CardGroup>

### CI/CD Pipeline

```mermaid theme={null}
graph LR
    A[Push to Branch] --> B[Run Tests]
    B --> C[Type Check]
    C --> D[Build]
    D --> E[Deploy Preview]
    E --> F[Manual Review]
    F --> G[Merge to Main]
    G --> H[Deploy Production]
```

## Support & Resources

<CardGroup cols={2}>
  <Card title="Slack Channel" icon="slack" href="https://weventures.slack.com/channels/expand-ai">
    \#expand-ai for team discussions
  </Card>

  <Card title="GitHub Issues" icon="github" href="https://github.com/Weventures-AI/expand-ai/issues">
    Report bugs and request features
  </Card>
</CardGroup>

<Info>
  **Next Steps**: Start with the [setup guide](/getting-started/expand-ai-setup) and review the driver documents in the repository.
</Info>
