Agent-Intake
Агент-переводчик между сырым пользовательским запросом и технической спецификацией для Navigator. Первое звено в pipeline анализа.
Назначение
Принимает сырой ввод (голос / текст / короткая формулировка) и через диалог упаковывает его в полноценную спецификацию которую ожидает Agent-NicheEvaluationDirector и другие analytics-агенты в existing Navigator pipeline.
Проблема которую решает: пользователь приходит с “эзотерика ниша, вечно зелёная, надо проанализировать” — а Navigator ожидает структурированный spec на 13 разделов. Без Intake gap между ожиданиями пользователя и возможностями системы = UX fail.
Stack
Python/Streamlit — в соответствии с existing synth-brain stack.
Location:
- UI:
src/synth_brain_ui/pages/intake.py(новая Streamlit page) - Logic:
src/synth_brain/intake/(новый модуль) - Templates:
src/synth_brain/intake/templates/*.json - Integration: переиспользует existing
src/synth_brain/chamber/иsrc/synth_brain/llm/
Ответственности
- Domain detection — определить тип анализа (market analysis / niche evaluation / startup due diligence / product strategy / competitive intelligence / custom)
- Template matching — подобрать relevant template
- Gap identification через Chamber — вызвать existing Chamber для brainstorm “что ещё нужно” (phase 2, не в MVP-lite)
- Adaptive clarification — 3-10 точечных вопросов по сложности
- Draft spec generation — полная спецификация
- User review & approval — preview + approve/corrections
- Handoff to Navigator — через existing intel_director input schema с correlation ID
Что Agent-Intake НЕ делает
- Не делает сам analysis (это Navigator)
- Не делает final judgment
- Не обрабатывает payments
- Не сохраняет long-term memory (session-based)
Входы / Выходы
Input
- Raw user input (voice transcript или text)
- User context (optional, phase 3+)
- Template library
Output — Structured Analysis Spec (JSON)
Контракт для handoff в Navigator:
{
"spec_id": "spec_2026_04_18_001",
"domain": "niche-evaluation",
"template_used": "niche-scaling-analysis-v1",
"original_input": "эзотерика ниша, вечно зелёная...",
"user_approved": true,
"sections": {
"market_analysis": {
"required": true,
"scope": "эзотерика: таро, астрология, прогнозы",
"regions": ["US", "EU", "RU", "LATAM", "SEA"],
"depth": "high"
},
"geo_priorities": { ... },
"product_matrix": { ... },
"audience_segments": { ... },
"cjm": { ... },
"funnels": { ... },
"sales_scripts": { "count": 5, ... },
"content_strategy": { ... },
"unit_economics": { ... },
"competitor_analysis": { "count_min": 5, "count_max": 10 },
"localization": { "languages_count": "10-15" },
"ai_sales_architecture": { ... }
},
"user_clarifications_collected": 7,
"chamber_gaps_identified": 12,
"estimated_navigator_cost": "$2.40",
"estimated_navigator_duration": "22 мин"
}Storage: status.json pattern (как в pipeline) для resume capability.
Tools
- Existing Chamber (
src/synth_brain/chamber/) — для brainstorm в phase 2 - Existing LLM clients (
src/synth_brain/llm/) — Sonnet для dialog, Haiku для классификации - Template library в JSON
- OpenAI Whisper API — voice transcription (phase 2)
- OpenAI TTS API — voice output (phase 2, optional)
Boundaries
Может сам (без HITL):
- Domain detection, template matching
- Clarifying questions
- Chamber для gaps (phase 2)
- Draft spec generation
Требует user approval (L3):
- Финальный spec перед Navigator
- Depth и breadth анализа (влияет на cost)
Эскалирует к HITL-Gateway (L4/L5):
- Estimated Navigator cost > $5
- Custom/ambiguous domain
- 3+ iterations без approve
- Sensitive content
Templates library (6 templates)
JSON в src/synth_brain/intake/templates/:
niche-evaluation.json— “стоит ли входить”, “проанализируй рынок”startup-due-diligence.json— “стоит ли инвестировать”content-strategy.json— “построй контент-план”product-strategy.json— “как позиционировать”competitive-intelligence.json— “разбор конкурентов”custom.json— fallback, triggers HITL
Каждый template:
{
"template_id": "niche-evaluation-v1",
"domain": "niche-evaluation",
"required_sections": [...],
"optional_sections": [...],
"default_clarifications": [...],
"navigator_handoff_format": "intel_director v1 input schema"
}Adaptive clarification logic
Complexity determination (Python classifier):
- Длина input: <50 слов = простой, 50-200 = средний, >200 = сложный
- Detected domains: 1 = простой, 2+ = complex
- Ambiguity score (Haiku): low / medium / high
- Scope breadth: 1 регион / 1 продукт = простой, global / multi = complex
Clarification depth:
| Сложность | Questions | Chamber gaps (phase 2) | Review iterations |
|---|---|---|---|
| Простой | 3 | 5 | 1 |
| Средний | 5-7 | 8-10 | 1-2 |
| Сложный | 8-10 | 12-15 | 2-3 |
Hard rule: max 10 questions per session.
Системный промпт (draft)
Ты — Intake Agent для analytics pipeline Synth Nova.
Задача: превратить сырой пользовательский запрос в структурированную
спецификацию для Navigator (analytics pipeline).
Работаешь в диалоге в Streamlit chat UI.
Шаги:
1. Прочти запрос. Классифицируй domain (niche-evaluation /
startup-due-diligence / content-strategy / product-strategy /
competitive-intelligence / custom).
2. Подбери template. Если custom — эскалируй к HITL-Gateway.
3. [Phase 2] Вызови Chamber: "Пользователь запросил [запрос]. Template
[template]. Критичные gaps? 5-10 коротких вопросов в JSON."
4. Combine template gaps + Chamber gaps → prioritized questions list.
Adaptive count (3-10 по сложности).
5. Задавай вопросы ПО ОДНОМУ. НЕ batch. Каждый учитывает предыдущий ответ.
6. Генерируй draft spec в JSON.
7. Human-readable preview: domain, template, sections, estimated cost,
estimated duration.
8. Approve или corrections. Max 3 iterations.
9. На approve → handoff в existing Navigator через intel_director
input schema с correlation_id.
Правила:
- Язык detect automatic (RU/EN)
- Короткие ответы
- Один вопрос за раз
- Честно называй cost и duration
- Sensitive content → HITL-Gateway
- Без user approve Navigator НЕ стартует
Критерии качества
Functional
- Domain detection accuracy: ≥ 90% на 20 test cases
- Spec completeness: все required sections заполнены
- First-iteration approval rate: ≥ 70%
UX
- Time to spec: ≤ 5 мин простой, ≤ 15 мин сложный
- Adaptive calibration: правильный tier на 85%+
- Voice latency: transcription < 3 сек (phase 2)
Economic
- Intake cost per session: ≤ 0.19 + dialog $0.05-0.10)
- Navigator retry rate: < 5% после intake
Quality
- Spec specificity: concrete parameters
- No hallucinated requirements
- Traceability: correlation_id end-to-end
Implementation phases
Phase 1 — MVP-lite (4-5 дней)
Включено:
- Streamlit chat UI на
/intake - 6 templates
- Domain detection (Claude Haiku)
- Template-based gap identification (без Chamber)
- Adaptive dialogue engine (rule-based)
- Spec generation + markdown preview + approval
- Handoff в existing Navigator с correlation_id
НЕ включено:
- Chamber integration (phase 2)
- Voice interface (phase 2)
- Advanced error handling (phase 3)
Phase 2 — Chamber + Voice (неделя после MVP)
- Chamber brainstorm integration
- Voice input (Whisper)
- Voice output (OpenAI TTS)
Phase 3 — Production polish (3-5 дней)
- Comprehensive error handling
- Session resume через status.json
- Metrics в Reports UI
- Rate limiting (10 sessions/user/day, как Chamber)
Open questions
-
Chamber brainstorm cost — 1.90 = $2.09+ total. OK для B2B, revisit для mass market.
-
Session persistence — status.json pattern recommended для resume.
-
Multi-user scaling — Streamlit singleton или per-session.
-
Language support — RU/EN для MVP. Больше phase 4+.
-
Failure modes matrix — Chamber timeout / LLM fail / transcription fail. Graceful degradation.
Связанные документы
- Agent-NicheEvaluationDirector — primary consumer
- Chamber-for-Strategic — tool для gaps (phase 2)
- HITL-Gateway — escalation
- Rules-Criticality — boundaries
- Working-Products — Navigator, Chamber as existing
- Template-Scenario — template format reference
- Onboarding-New-Claude — entry point