"""Seed roadmap notes via the notes API."""
import urllib.request, json, time

BASE = "http://localhost:5000/api/dashboard/notes"

notes = [
    {"title": "v1.0 \u2014 Production", "content": """Model: GPT-4.1-mini
Search: Vector search (pgvector, IVFFlat)
Stock: API Magento realtime
Prompt: Module v1 (persona, guardrails, sales flow)
Observability: Langfuse tracing + scoring
Chat: L\u01b0u l\u1ecbch s\u1eed + Like/Dislike feedback""", "category": "note", "pinned": True},

    {"title": "v1.1 \u2014 \u0110\u1ed5i model (th\u1eed nghi\u1ec7m)", "content": """Chuy\u1ec3n GPT-4.1-mini \u2192 Gemini 3.1 Flash-Lite
Gi\u1ea3m ~55% chi ph\u00ed per request
R\u00fat g\u1ecdn prompt 56%, format ph\u00f9 h\u1ee3p Gemini
Benchmark: 20 test cases so s\u00e1nh Score/Latency/Cost
C\u01a1 ch\u1ebf rollback v\u1ec1 GPT n\u1ebfu Gemini kh\u00f4ng \u1ed5n""", "category": "note", "pinned": True},

    {"title": "v1.2 \u2014 \u0110\u1ed5i logic l\u1ea5y d\u1eef li\u1ec7u (th\u1eed nghi\u1ec7m)", "content": """Hybrid Search: vector + keyword thay v\u00ec vector-only
HNSW Index thay IVFFlat \u2192 recall t\u0103ng ~15%
Filters n\u00e2ng cao: l\u1ecdc gi\u00e1, m\u00e0u, size, danh m\u1ee5c tr\u01b0\u1edbc khi search
Caching layer (Redis): cache k\u1ebft qu\u1ea3 search ph\u1ed5 bi\u1ebfn, gi\u1ea3m latency""", "category": "note", "pinned": True},

    {"title": "v2.0 \u2014 N\u00e2ng c\u1ea5p l\u1edbn (k\u1ebf ho\u1ea1ch)", "content": """Prompt Engineering v2: rewrite to\u00e0n b\u1ed9, multi-turn context, persona n\u00e2ng cao
Giao di\u1ec7n chatbot m\u1edbi: dark mode, product cards, quick replies
Multi-Agent: Sales Agent + Support Agent + Analytics Agent ph\u1ed1i h\u1ee3p
A/B Testing Engine: so s\u00e1nh prompt/model variants tr\u00ean live traffic
Customer Analytics Dashboard: ph\u00e2n t\u00edch h\u00e0nh vi kh\u00e1ch h\u00e0ng t\u1eeb chat data""", "category": "note", "pinned": True},
]

for note in notes:
    body = json.dumps(note).encode("utf-8")
    req = urllib.request.Request(BASE, data=body, headers={"Content-Type":"application/json"}, method="POST")
    urllib.request.urlopen(req)
    time.sleep(0.3)

print(f"Seeded {len(notes)} roadmap notes OK")
