A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
| { | |
| "customModes": [ | |
| { | |
| "slug": "sparc", | |
| "name": "⚡️ SPARC Orchestrator", | |
| "roleDefinition": "You are SPARC, the orchestrator of complex workflows. You break down large objectives into delegated subtasks aligned to the SPARC methodology. You ensure secure, modular, testable, and maintainable delivery using the appropriate specialist modes.", | |
| "customInstructions": "Follow SPARC:\n\n1. Specification: Clarify objectives and scope. Never allow hard-coded env vars.\n2. Pseudocode: Request high-level logic with TDD anchors.\n3. Architecture: Ensure extensible system diagrams and service boundaries.\n4. Refinement: Use TDD, debugging, security, and optimization flows.\n5. Completion: Integrate, document, and monitor for continuous improvement.\n\nUse `new_task` to assign:\n- spec-pseudocode\n- architect\n- code\n- tdd\n- debug\n- security-review\n- docs-writer\n- integration\n- post-deployment-monitoring-mode\n- refinement-optimization-mode\n\nValidate:\n✅ Files < 500 lines\n✅ No hard-coded |
| - After making changes, ALWAYS make sure to start up a new server so I can test it. | |
| - Always look for existing code to iterate on instead of creating new code. | |
| - Do not drastically change the patterns before trying to iterate on existing patterns. | |
| - Always kill all existing related servers that may have been created in previous testing before trying to start a new server. | |
| - Always prefer simple solutions | |
| - Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality | |
| - Write code that takes into account the different environments: dev, test, and prod | |
| - You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested | |
| - When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d |
Use case: Working with PDF text books, it can be helpful to be able to extract problems and images to use in notes and when working problemsets on the reMarkable tablet.
These instructions are MacOS centric, but should be reproducable on most platforms as the tools are fairly platform agnostic.
| #!/bin/bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| # $IG_URLS as env | |
| # GET auth token to be used in curl/rest api | |
| AUTH_TOKEN=$(gcloud auth print-access-token) |
| #! /bin/bash | |
| set -o errexit | |
| export APP="${1:-mutateme}" | |
| export NAMESPACE="${2:-default}" | |
| export CSR_NAME="${APP}.${NAMESPACE}.svc" | |
| echo "... creating ${app}.key" | |
| openssl genrsa -out ${APP}.key 2048 |
| <!DOCTYPE NETSCAPE-Bookmark-file-1> | |
| <!-- This is an automatically generated file. | |
| It will be read and overwritten. | |
| DO NOT EDIT! --> | |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
| <TITLE>Bookmarks</TITLE> | |
| <H1>Bookmarks</H1> | |
| <DL><p> | |
| <DT><H3 ADD_DATE="1626629115" LAST_MODIFIED="1626629462" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3> | |
| <DL><p> |
| SUBSYSTEM!="sound", GOTO="pulseaudio_end" | |
| ACTION!="change", GOTO="pulseaudio_end" | |
| KERNEL!="card*", GOTO="pulseaudio_end" | |
| SUBSYSTEMS=="pci", ATTRS{vendor}=="0x106b", ATTRS{device}=="0x1803", ENV{PULSE_PROFILE_SET}="apple-t2.conf" | |
| LABEL="pulseaudio_end" |
| #! /bin/sh | |
| set -o errexit | |
| export APP="${1:-mutateme}" | |
| export NAMESPACE="${2:-default}" | |
| export CSR_NAME="${APP}.${NAMESPACE}.svc" | |
| echo "... creating ${app}.key" | |
| openssl genrsa -out ${APP}.key 2048 |