kimi-integration-workflow.md
4.34 KB
Kimi API Integration for WeChat Daily Digest
When to Use
Use Kimi API for deep analysis of WeChat group discussions when:
- User wants deeper insights beyond surface-level summaries
- Need to identify hot topics, key viewpoints, and technology trends
- Want to analyze discussion patterns and participant engagement
- Generating professional infographic prompts
Setup
Kimi API key is stored in ~/.kimi_api_key (loaded by kimi-api skill).
Integration Points
1. Discussion Analysis
After extracting chat messages, use Kimi to analyze discussions:
from kimi_client import simple_chat
discussion_text = "\n".join([f"{m['sender']}: {m['content']}" for m in messages])
analysis = simple_chat(f"""
Analyze these WeChat group discussions and summarize:
1. Top 3 hot topics (20 chars each)
2. Key viewpoints for each topic
3. Technology trends (5 points)
4. What deserves attention
Discussions:
{discussion_text}
""", timeout=90)
Output: Structured analysis with topics, viewpoints, trends, and priorities.
2. Infographic Prompt Design
Use Kimi to design professional infographic prompts:
prompt_design = simple_chat("""
Design a professional vintage newspaper infographic prompt template for WeChat daily digest.
Requirements:
- Retro Chinese newspaper style, beige background (#f5f0e1)
- Title: "AI AGI 日报" + group name + date + edition
- Stats bar: article count, discussion count, field count, active members
- Article sections with category themes (blue/purple/green/orange/red/gray)
- Each article: bold headline + one-sentence summary + source
- Hot discussions section with speech bubbles and quotes
- Footer: generation time + data source
Output: A complete English prompt for AI image generation (Midjourney/DALL-E/Stable Diffusion).
""")
Output: Detailed prompt with layout, colors, typography, and decorative elements.
3. Report Enhancement
Use Kimi to enhance the generated report with deeper analysis:
enhanced_report = simple_chat(f"""
Enhance this WeChat daily digest report with:
1. More detailed technology trend analysis
2. Key insights and implications
3. Actionable recommendations
4. Cross-reference with industry news
Current report:
{report_text}
""")
Workflow Integration
Raw Messages
↓
Extract Articles (XML parsing)
↓
Extract Discussions (text grouping)
↓
[Kimi Analysis] ← Optional but recommended
↓
Generate Complete Report (Markdown)
↓
Generate Infographic (Gemini/Pillow)
↓
Send to Contact (ACTION_SEND)
Models
kimi-k2.6: Main model for analysis and prompt design (200K context, supports search)moonshot-v1-8k-vision-preview: For image analysis if neededmoonshot-v1-128k-vision-preview: For long text + image analysis
Temperature Notes
kimi-k2.6only supportstemperature=1(will error with other values)- For consistent analysis results, use default temperature=1
Error Handling
- Kimi API may timeout on complex analysis (use timeout=90-120s)
- If search times out, fall back to direct chat without search
- If analysis fails, use local extraction logic as fallback
Example Output
Discussion Analysis
### 1. 今日最热门的3个话题
- **话题一**:Agent-Reach开源发布(AI Agent联网读取工具)
- **话题二**:Project-LLM-Wiki代码缓存优化方案
- **话题三**:Claude API使用成本过高讨论
### 2. 每个话题的关键观点
**话题一:Agent-Reach开源工具**
- 支持多平台信息抓取,补齐Agent实时联网读取能力的短板
- 开源社区反响活跃,生态共建势头明显
- 作为基础设施级工具,可降低Agent开发门槛
### 3. 今日技术趋势总结(5个要点)
1. **Agent基础设施层爆发**:互联网读取、代码缓存等基础能力工具开源化
2. **降本增效成为工程化核心**:Token优化、缓存机制受到重视
3. **多模态能力持续迭代**:视频生成、图像理解等方向技术能力稳步提升
4. **AI硬件进入落地期**:具身智能、AI健身等垂直场景硬件产品加速商业化
5. **开发流程趋向规范化**:减少冗余调用、优化编码流程成为社区共识
Infographic Prompt Design
A professional vintage newspaper infographic poster for a WeChat group daily digest...
[Complete prompt with layout, colors, typography, decorative elements]