Skip to content
reaatech

Files · Listing Copy Multiplier for Residential Brokers

78 (1 binary, 536.1 kB total)attempt 1

README.md·3861 B·markdown
markdown
# Listing Copy Multiplier for Residential Brokers
 
> Generate 4 platform-optimized listing variants from one draft in under 2 minutes.
 
A reference solution demonstrating how to build a provider-agnostic document-pipeline application with the `@reaatech/*` package family.
 
## Problem
 
A solo broker or small-team agent spends 45+ minutes rewriting the same listing description for MLS, Zillow, social media, and a printed brochure. Each platform has different character limits, tone preferences, and keyword requirements. This repetitive copy work eats into prospecting and showing time.
 
## Solution
 
The Listing Copy Multiplier accepts a single draft listing and generates 4 platform-optimized variants in under 2 minutes using the Vercel AI SDK with OpenAI. It caches results via `@reaatech/llm-cache`, routes model selections via `@reaatech/llm-router-core`, traces requests with OpenTelemetry (`@reaatech/otel-genai-semconv-core`), stores history in ChromaDB, and supports golden-trajectory evaluation (`@reaatech/agent-eval-harness-golden`).
 
## Architecture
 
| Layer | Technology |
|---|---|
| Web framework | Next.js 16+ (App Router) |
| AI provider | OpenAI (via `ai` + `@ai-sdk/openai`) |
| LLM cache | `@reaatech/llm-cache` |
| Model routing | `@reaatech/llm-router-core` |
| OTel tracing | `@reaatech/otel-genai-semconv-core` |
| Eval harness | `@reaatech/agent-eval-harness-golden` |
| Vector store | ChromaDB (`chromadb`) |
| Observability | Langfuse (`langfuse`) |
 
## Platforms supported
 
| Platform | Char limit | Tone |
|---|---|---|
| MLS Listing | 5,000 | professional |
| Zillow | 2,000 | engaging |
| Social Media | 500 | casual |
| Printed Brochure | 3,000 | luxury |
 
## Getting started
 
```bash
pnpm install
pnpm dev             # next dev at http://localhost:3000
pnpm test            # vitest run with coverage
```
 
Set the following environment variables in `.env`:
 
```
OPENAI_API_KEY=<your-openai-key>
LANGFUSE_PUBLIC_KEY=<your-langfuse-public-key>
LANGFUSE_SECRET_KEY=<your-langfuse-secret-key>
LANGFUSE_BASE_URL=https://cloud.langfuse.com
CHROMA_URL=http://localhost:8000
LLM_CACHE_ENABLED=true
```
 
## API
 
### POST /api/generate
 
Generate listing variants for one or more platforms.
 
```json
{
  "draft": {
    "content": "Beautiful 3-bedroom home in downtown...",
    "price": 450000,
    "bedrooms": 3,
    "bathrooms": 2,
    "squareFeet": 1800,
    "propertyType": "Single Family",
    "agentName": "Jane Doe",
    "agencyName": "Premier Realty",
    "features": ["Updated kitchen", "Hardwood floors"]
  },
  "platforms": ["mls", "zillow", "social", "brochure"]
}
```
 
### GET /api/platforms
 
List all available platforms and their constraints.
 
## REAA packages used
 
- `@reaatech/hybrid-rag` — foundation Document types for listing data
- `@reaatech/agents-markdown` — utility functions (`randomId`, `groupBy`)
- `@reaatech/llm-cache` — exact-match and semantic LLM response caching
- `@reaatech/agent-eval-harness-golden` — golden trajectory comparison
- `@reaatech/llm-router-core` — model definition and routing schemas
- `@reaatech/otel-genai-semconv-core` — OTel GenAI span builder
 
## Development
 
```bash
pnpm typecheck       # tsc --noEmit
pnpm lint            # eslint .
pnpm test            # vitest run --coverage
```
 
## Project layout
 
```
app/                  Next.js App Router pages + API routes
src/
  types/              Domain types (ListingDraft, Platform, ListingVariant)
  lib/                Platform definitions and prompt builder
  services/           Orchestration (ListingService, VariantGenerator)
  listing-copy.ts     REAA package import verification + service factory
tests/                vitest suite (mirrors src/)
packages/             API references for every dependency
DEV_PLAN.md           build plan for this recipe
```
 
## License
 
MIT — see [LICENSE](./LICENSE).