Skip to content

[B2c] Show project stats in TUI sidebar #176

Description

@four-bytes-robby

Purpose

Display live project stats (files indexed, chunks, memories, KB entries) in the brain TUI sidebar.

Design

  1. Add getProjectStats() function in src/status.ts (or new src/stats.ts):

    • Query DB for: document count, chunk count, memory count, KB entry count
    • Cache for 30s (no need to re-query on every status update)
  2. Extend BrainStatusEvent payload in src/status.ts:

    • Add optional stats field: { documents: number, chunks: number, memories: number, kbEntries: number }
  3. Extend BrainStatusBar in src/tui.tsx:

    • Sidebar variant: add third row below progress bar showing compact stats
    • Format: 📄 142 files · 🧩 847 chunks · 🧠 23 memories · 📚 5 KB
    • Only show when stats available and state is "ready"

Acceptance

  • Project stats visible in TUI sidebar when brain is ready
  • Counts update after ingest completes
  • No flicker (30s cache)
  • Tests: stats computation, TUI rendering with stats

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions