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.
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| /** | |
| * A modifier that clips the composable content using a circular reveal animation. The circle will | |
| * expand or shrink whenever [isVisible] changes. | |
| * | |
| * For more control over the transition, consider using this method's variant which allows passing | |
| * a [State] object to control the progress of the reveal animation. | |
| * | |
| * By default, the circle is centered in the content. However, custom positions can be specified using |
| #!/bin/bash | |
| let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" | |
| let secs=$((${upSeconds}%60)) | |
| let mins=$((${upSeconds}/60%60)) | |
| let hours=$((${upSeconds}/3600%24)) | |
| let days=$((${upSeconds}/86400)) | |
| UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"` | |
| # get the load averages | |
| read one five fifteen rest < /proc/loadavg |
| import android.graphics.Canvas | |
| import android.graphics.Rect | |
| import android.support.v7.widget.RecyclerView | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| /** | |
| * Created with Android Studio | |
| * User: Sergey Petrov s.a.petrov.spb@gmail.com |
| @Composable | |
| fun ParallaxScreen(modifier: Modifier = Modifier) { | |
| val context = LocalContext.current | |
| val scope = rememberCoroutineScope() | |
| var data by remember { mutableStateOf<SensorData?>(null) } | |
| DisposableEffect(Unit) { | |
| val dataManager = SensorDataManager(context) | |
| dataManager.init() |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
| import android.app.Activity | |
| import android.content.Intent | |
| import android.content.IntentSender | |
| import android.os.Bundle | |
| import android.widget.Toast | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.core.content.ContextCompat | |
| import com.google.android.material.snackbar.Snackbar | |
| import com.google.android.play.core.appupdate.AppUpdateManager | |
| import com.google.android.play.core.appupdate.AppUpdateManagerFactory |
| /** | |
| * Optimize image image | |
| * | |
| * https://developers.google.com/speed/docs/insights/OptimizeImages | |
| * -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB | |
| * | |
| * @access public | |
| * @param string $filePath Path of the file | |
| * @return string Raw image result from the process | |
| */ |