#+TITLE: SKILL: Atomic Notes Retrieval (Universal Literate Note) #+ID: skill-atomic-notes #+STARTUP: content #+FILETAGS: :knowledge:retrieval:zettelkasten:psf: * Overview This skill provides the **Deep Memory** for the agent. it enables **Sparse Tree Perception** over the Zettelkasten, using semantic search and recursive interlinking to maintain high-signal context without token bloat. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Define the interfaces for knowledge retrieval from the atomic note DAG. ** 2. User Needs - **Atomicity:** Each note represents exactly one concept. - **Sparse Tree Perception:** Extract headlines and IDs before deep reading. - **Recursive Deep-Dive:** Follow internal links to pull related context. - **Search Efficiency:** Optimized searching via `ripgrep`. ** 3. Success Criteria *** TODO Concept Discovery *** TODO Link Resolution *** TODO Sparse Tree Extraction Verification * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Interfaces for scanning and resolving nodes in the Zettelkasten. Source of truth is `$MEMEX_NOTES`. ** 2. Semantic Interfaces #+begin_src lisp (defun atomic-notes-perceive (query) "Performs a sparse-tree scan of the Zettelkasten.") (defun atomic-notes-resolve-link (link-target) "Follows a link (ID or file) to retrieve the target node content.") #+end_src * Phase D: Build (Implementation) ** Sparse Perception #+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp (defun atomic-notes-perceive (query) "Performs a sparse-tree scan of the Zettelkasten for the given query." (let ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))) (kernel-log "MEMORY - Scanning Atomic Notes for: ~a" query) (uiop:run-program (list "rg" "-i" query notes-dir) :output :string))) #+end_src ** Link Resolution #+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp (defun atomic-notes-resolve-link (link-target) "Resolves a link to a physical Org file." (let ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))) ;; Logic to handle [[id:UUID]] vs [[file:path.org]] (format nil "Resolving link: ~a" link-target))) #+end_src * Registration #+begin_src lisp (defskill :skill-atomic-notes :priority 90 :trigger (lambda (context) nil) :neuro (lambda (context) nil) :symbolic #'atomic-notes-perceive) #+end_src