Problem
Ingestion only runs lazily via ensure_fresh_data() inside query tools. If no queries are made, data goes stale indefinitely — last ingestion was Jan 31 despite the server being active.
Additionally, client machines (Mac) have no automated push schedule to sync their local session data to the server.
Solution
Part 1: Server-side background ingestion
Add a FastMCP lifespan with a background asyncio task that runs ingest_logs() every 5 minutes, plus initial ingest on startup.
Part 2: Client-side scheduled push
Add LaunchAgent (macOS) and systemd timer (Linux) templates for periodic agent-session-analytics-cli push, wired into make install-client.
Files
server.py — lifespan + background loop
- New push schedule templates (plist, systemd timer/service)
- New install/uninstall scripts
- Makefile update
- Documentation
Problem
Ingestion only runs lazily via
ensure_fresh_data()inside query tools. If no queries are made, data goes stale indefinitely — last ingestion was Jan 31 despite the server being active.Additionally, client machines (Mac) have no automated push schedule to sync their local session data to the server.
Solution
Part 1: Server-side background ingestion
Add a FastMCP
lifespanwith a background asyncio task that runsingest_logs()every 5 minutes, plus initial ingest on startup.Part 2: Client-side scheduled push
Add LaunchAgent (macOS) and systemd timer (Linux) templates for periodic
agent-session-analytics-cli push, wired intomake install-client.Files
server.py— lifespan + background loop