Skip to content

feat: 支持深度洞察报告导出(按时间段:日报/周报/月报/季报/年报) #29

Description

@baoyu0

需求描述

当前 OpenWiki 的 Data Hub 导出功能仅支持导出原始捕获内容(clipboard 保存的文本/链接/图片),但 AI 生成的深度洞察雷达报告(Radar Report) 无法导出。对于知识管理用户来说,真正有价值的是 AI 整合后的洞察报告,而非零散的原始素材。

希望能增加深度洞察报告的导出功能,并支持按时间段聚合导出,覆盖以下场景:

  • 日报 — 当天捕获内容的 AI 洞察摘要
  • 周报 — 本周注意力雷达分析报告
  • 月报 — 月度主题回顾与趋势分析
  • 季报 — 季度深层兴趣模式分析
  • 年报 — 年度知识轨迹全景回顾

参考现有架构

深度洞察数据结构(Rust 侧)

当前 RadarReport 已定义完整的数据结构(src-tauri/src/.../radar.rs),包含以下章节,非常适合导出为结构化文档:

章节 字段 说明
At a Glance at_a_glance: Vec<Glance> 概览要点
Info Diet info_diet: InfoDiet 信息源分布分析
Subconscious subconscious: Vec<SubconsciousItem> 隐性关注/潜意识主题
Graveyard graveyard: Graveyard 被遗忘的有价值内容
Blind Spots blind_spots: Vec<BlindSpot> 认知盲区
Actions actions: Vec<Action> 行动建议
Heatmap heatmap: Vec<HeatmapDay> 活动热力图
Topic Cloud topic_cloud: Vec<TopicItem> 主题云分布
Verdict verdict: Verdict 综合评价结论
Footer footer: Footer 统计摘要(日期范围、总数、活跃天数)

已有导出基础设施

  • src-tauri/src/export/markdown.rs — 已实现完整的 Markdown 导出管道(export_day、export_all、export_date_range、export_all_single_file、export_range_single_file)
  • src/features/data-hub/ExportPanel.tsx — 前端导出面板 UI
  • 可复用现有导出目录选择、文件写入、打开 Finder 等交互

数据存储方式

深度洞察分析结果存储在 SQLite attention_insights 表的 analysis_json 字段(JSON 字符串),通过 get_attention_insights() 和 trigger_attention_analysis() 命令操作。前端已有 RadarView 和 InsightDetail 组件渲染报告。

建议实现方案

后端(Rust)

  1. 在 src-tauri/src/export/ 下新增 report.rs,实现:
    • export_report_markdown(report: &RadarReport) -> String — 将 RadarReport 序列化为结构化 Markdown
    • export_report_json(report: &RadarReport) -> String — 可选:JSON 格式导出,便于二次处理
  2. 新增 Tauri 命令(在 src-tauri/src/commands/ 或 lib.rs):
    • export_report_today() — 导出今日洞察
    • export_report_weekly() — 自动聚合本周生成的最新报告
    • export_report_range(start, end) — 时间段内的洞察聚合
    • 或复用 export_date_range_markdown 模式的多个粒度命令
  3. 时间段聚合逻辑:查询 attention_insights 表,按 window_start/window_end 字段筛选对应时间范围内的报告,合并输出

前端(TypeScript/React)

  1. 在 src/features/digest/ 或 src/features/data-hub/ 新增导出入口:
    • 在 RadarView 添加导出按钮
    • 或在 ExportPanel 添加"导出深度洞察报告"区域
  2. 提供时间段选择器:日报/周报/月报/季报/年报
  3. 提示导出成功并打开导出目录

为何需要此功能

OpenWiki 的本质是"你决定留什么,AI 帮你理清楚"。当前"理清楚"的这一步(深度洞察报告)只能在 App 内部阅读,无法沉淀为可分享、可存档、可二次处理的文档。增加报告导出能力后,用户可以:

  • 将周报发给团队成员或自己
  • 将年度洞察归档到个人知识库
  • 在 Obsidian/Notion 等工具中进一步加工整合
  • 打印或生成 PDF 长期保存

相关信息

  • 操作系统:Windows / macOS
  • 当前版本:latest(main 分支)

Activity

  1. baoyu0 commented on Jul 5, 2026

    @baoyu0
    Author

    [English Version] Feature Request: Export Deep Insight (Radar Report) with Time-Period Aggregation (Daily/Weekly/Monthly/Quarterly/Yearly)

    Problem:
    The current Data Hub export feature only exports raw captured content (text snippets, links, images as Markdown files). The AI-generated Deep Insight (Radar Report) — which is the most valuable output of OpenWiki — cannot be exported. Raw material exports without the AI analysis layer have limited practical value for knowledge management.

    Requested Feature:
    Add the ability to export the Deep Insight (Radar Report) as structured documents, with time-period aggregation:

    Period Description
    Daily AI insight summary of the day's captured content
    Weekly Full Radar attention analysis for the week
    Monthly Monthly theme review and trend analysis
    Quarterly Quarterly deep interest pattern analysis
    Yearly Annual knowledge-trajectory panoramic review

    Technical Context (from codebase analysis):

    The RadarReport struct (in src-tauri/src/.../radar.rs) already contains well-defined sections ideal for export:

    Section Field Description
    At a Glance at_a_glance: Vec<Glance> Key overview points
    Info Diet info_diet: InfoDiet Source distribution analysis
    Subconscious subconscious: Vec<SubconsciousItem> Latent interests/themes
    Graveyard graveyard: Graveyard Forgotten but valuable content
    Blind Spots blind_spots: Vec<BlindSpot> Cognitive blind spots
    Actions actions: Vec<Action> Suggested next steps
    Heatmap heatmap: Vec<HeatmapDay> Activity heatmap
    Topic Cloud topic_cloud: Vec<TopicItem> Topic distribution
    Verdict verdict: Verdict Overall conclusion
    Footer footer: Footer Stats summary

    Existing Infrastructure to Leverage:

    • src-tauri/src/export/markdown.rs — complete Markdown export pipeline with export_day, export_all, export_date_range, single-file variants
    • src/features/data-hub/ExportPanel.tsx — frontend export panel UI
    • The export directory selection, file writing, and Finder/Explorer opening logic can all be reused

    Data Storage:
    Radar analysis results are stored as JSON strings in the analysis_json column of the SQLite attention_insights table, accessed via get_attention_insights() and trigger_attention_analysis() commands.

    Suggested Implementation:

    Rust Backend:

    1. Add src-tauri/src/export/report.rs with:
      • export_report_markdown(report: &RadarReport) -> String — serialize RadarReport to structured Markdown
      • export_report_json(report: &RadarReport) -> String — optional JSON export for further processing
    2. Add new Tauri commands: export_report_range(start, end, period) where period controls aggregation granularity
    3. Query attention_insights table filtered by window_start/window_end for time-range selection

    TypeScript/React Frontend:

    1. Add export entry point in RadarView or ExportPanel
    2. Provide a period selector: Daily/Weekly/Monthly/Quarterly/Yearly
    3. Show success notification and open export directory

    Why This Matters:
    OpenWiki's value proposition is "You decide what to keep. AI makes sense of it." Currently the "makes sense of it" part (the Deep Insight report) is locked inside the app. Export capability would let users:

    • Share weekly reports with teams or their future selves
    • Archive yearly insights into personal knowledge bases
    • Further process in Obsidian, Notion, or other tools
    • Print or generate PDFs for long-term preservation
  2. kdsz001 commented on Jul 5, 2026

    @kdsz001
    Owner

    感谢这个非常清晰的需求,也谢谢把现有数据结构和导出链路都梳理出来。

    这个方向我们会采纳,不过会先拆成两步做,避免第一版范围过大:

    1. 第一阶段先支持导出「当前/最新一份深度洞察报告」为 Markdown,入口会放在深度洞察报告页面本身,方便直接归档、分享或交给 Obsidian / Notion / AI 工具继续处理。
    2. 第二阶段再考虑按时间范围导出历史报告,以及更完整的日报/周报/月报/季报/年报能力。

    这里有个产品边界需要稍微谨慎一下:月报、季报、年报不应该只是把几份已有报告拼在一起,否则会变成“历史记录导出”,不是真正的周期洞察。更理想的做法是针对选定时间范围重新跑一次聚合分析,生成新的周期报告。所以这部分会放到后续单独设计。

    第一版 MVP 我们会先落到 Markdown 导出,尽快把最核心的“AI 整理后的洞察可以带走”这件事补上。

  3. baoyu0 commented on Jul 5, 2026

    @baoyu0
    Author

    回复思路很清晰,两步走确实是这个功能最稳健的路径。

    Phase 1 先做「当前报告 → Markdown」,快速打通「AI 洞察能带走」这个闭环,MVP 就该这么切。

    关于 Phase 2 的周期报告,我理解你的产品判断——月报/季报/年报不应该只是已有报告的拼接,否则跟「历史记录导出」没区别。更准确的类比是财务分析报告:年报不是把 12 张月报粘在一起,而是拉取全年的原始流水重新做一次聚合、归因、趋势分析,最后生成一份独立完整的报告。你提到的「针对时间窗口重新跑聚合分析」正是这个逻辑。

    这个思路很关键,也意味着数据层的设计从一开始就要区分两种能力:展示已有报告 vs 按时间段重新聚合生成。这部分确实值得单独设计,后面如果有了初步方案我可以一起参与讨论。

    整体方向很认同,期待 Phase 1 落地,OpenWiki 的洞察力就真正能带出去了 💪

  4. baoyu0 commented on Jul 5, 2026

    @baoyu0
    Author

    Great breakdown, the two-phase approach is the right call.

    Phase 1 — exporting the current Radar Report to Markdown — is the most pragmatic first step. It closes the core loop ("AI insights can be taken out") quickly without over-scoping.

    Regarding Phase 2, I fully agree that monthly/quarterly/yearly reports shouldn't be a simple concatenation of existing reports — otherwise it's just "history export" rebranded. A better analogy is financial reporting: an annual report isn't 12 monthly reports stapled together. Instead, you pull the full year's raw data and run a fresh aggregation, attribution, and trend analysis to produce a standalone, independent report. Your instinct to "re-run aggregation analysis for the selected time window" is exactly that logic.

    This distinction also has architectural implications — the data layer needs to support two separate paths from the start: rendering an existing report vs. aggregating from scratch over a time range. Definitely worth a dedicated design phase.

    Looking forward to Phase 1 landing — once the Radar Report can walk out of the app, OpenWiki's full value proposition finally becomes portable 🚀

  5. kdsz001 commented on Jul 5, 2026

    @kdsz001
    Owner

    Thanks, this is exactly the distinction I want to keep clear.

    Phase 1 is now implemented and will ship in the next release: the latest completed Deep Insight / Radar Report can be exported directly to Markdown from the insight report section. This keeps the first version focused on making the current AI-generated report portable without turning it into a larger reporting system too early.

    For Phase 2, I agree with your framing. Daily / monthly / quarterly / yearly reports should be generated from the raw captured content over the selected time window, not stitched together from existing reports. That means we should treat it as a separate aggregation/report-generation path in the data and product design.

    I’ll keep this issue open to track the broader period-based reporting work, while the Phase 1 Markdown export goes out first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions