Add RSS knowledge expiry, recent_knowledge and promote_knowledge tools #9
Loading…
Reference in a new issue
No description provided.
Delete branch "rss-knowledge-expiry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the two features discussed in issue #6, plus a
promote_knowledgetool as requested by @ric_harvey.Changes
expires_atfield on RSS-ingested knowledge itemsAt ingest time, the RSS worker now sets
expires_at = created_at + MAX_KNOWLEDGE_AGE_DAYS * 86400on every ingested article.MAX_KNOWLEDGE_AGE_DAYSis a new env var (default 30). Manually stored knowledge items viaremember(namespace="knowledge")never getexpires_atset, so they are unaffected.During auto-maintenance (Phase 3, global), any RSS-ingested item (identified by
feed_namebeing set) whoseexpires_athas passed is archived. Therun_maintenancereturn dict gains aknowledge_expiredkey listing archived keys.The
idx:knowledgeindex gains aNumericField("expires_at")— the existing startup migration handles the field count change automatically.recent_knowledgetoolQuery knowledge items by recency rather than relying on vector similarity scoring:
Returns active knowledge items created within the lookback window, sorted newest first. Optionally filter by feed name or topic tags. Days clamped to 1–365, limit to 1–50.
promote_knowledgetoolMark an RSS-ingested article as permanently useful by clearing its
expires_at:Clears
expires_atso the item is never auto-archived. Returns an error if the key is not in the knowledge namespace, does not exist, or is already archived.Tests
17 new tests covering all three features, using in-memory fakes (no Docker required):
tests/test_knowledge_tool.py— 15 tests forrecent_knowledgeandpromote_knowledgetests/test_knowledge_maintenance.py— 7 tests forexpire_knowledge_itemsandrun_maintenanceFull suite: 438 passed, 1 pre-existing unrelated failure (
test_sorted_newest_first).Closes #6
Pull request closed