Back to Home
I built a time-decaying knowledge graph for my terminal — here's how it works

I built a time-decaying knowledge graph for my terminal — here's how it works

B
Blizine Admin
·2 min read·0 views

Prajwal Ashok Hulle Posted on May 31 I built a time-decaying knowledge graph for my terminal — here's how it works # ai # opensource # productivity # python TerminalPulse — Automatic Context Capture for AI-Assisted Debugging Every time I used Claude or ChatGPT to fix a bug, I went through the same ritual: Read the traceback Copy the error Switch to AI chat Explain my project, branch, and current file Paste relevant code Wait for a response Switch back to the terminal That's a surprising amount of friction repeated dozens of times per week. So I built TerminalPulse — a background daemon that continuously captures development context and makes it instantly available when something breaks. When a command fails: pulse fix Enter fullscreen mode Exit fullscreen mode The context is already there. Core Idea TerminalPulse builds a time-decaying context graph from three event streams: Focus — active file in VS Code Activity — recently modified files Distress — failed terminal commands Each event receives a heat score: heat = e^(-λ × age_seconds) × severity Enter fullscreen mode Exit fullscreen mode where: λ = decay constant age_seconds = current_time - event_time severity = importance weight of the event Older events naturally fade away while recent events remain highly ranked. The goal is to provide AI tools with the context that is relevant now, rather than a large amount of stale project history. Architecture VS Code (Windows) → HTTP:7077 ─┐ Terminal errors → Unix socket ─┼─→ pulsed daemon File saves → watchdog ─┘ pulsed daemon ↓ ~/.devpulse_state.json ↓ pulse fix ↓ TerminalMind / AI Provider ↓ Suggested Fix Enter fullscreen mode Exit fullscreen mode The daemon is implemented as a long-running Python asyncio process containing: Unix socket server for shell-hook events HTTP server for editor-focus events Filesystem watchdog for file activity Shell integration is intentionally lightweight. A small bash hook runs after failed commands and sends a compact JSON payload to t

📰Dev.to — dev.to

Comments