Skip to content

Instantly share code, notes, and snippets.

@jmsmrgn
jmsmrgn / llm-wiki.md
Created April 6, 2026 23:48 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

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.

The core idea

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.

Keybase proof

I hereby claim:

  • I am jmsmrgn on github.
  • I am jmsmrgn (https://keybase.io/jmsmrgn) on keybase.
  • I have a public key ASCjDRHgAI0o4Zzt_NmDpQCBJvELDCoffpHOc3bHJ5MGPgo

To claim this, I am signing this object:

@jmsmrgn
jmsmrgn / osascript
Created April 17, 2018 21:06
Manipulate login items from command line
osascript -e 'tell application "System Events" to get the name of every login item'
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Name of app.app", hidden:false}'
osascript -e 'tell application "System Events" to delete login item "itemname"'
@jmsmrgn
jmsmrgn / sass-loader-options.js
Created December 21, 2016 23:25
webpack - sass loader data options
new webpack.LoaderOptionsPlugin({
options: {
sassLoader: {
data: '@import "app/styles/settings/_settings.scss";',
includePaths: 'app/styles'
},
context: path.resolve(__dirname, '../../') // must evaluate to root of project
}
})
@jmsmrgn
jmsmrgn / async-scripts.php
Created February 1, 2016 21:29
WP - Async script load
// Async load
function async_scripts($url) {
if (strpos( $url, '#asyncload') === false) {
return $url;
} else if (is_admin()) {
return str_replace('#asyncload', '', $url );
} else {
return str_replace('#asyncload', '', $url )."' async='async";
}
}
@jmsmrgn
jmsmrgn / search-filter.php
Created January 24, 2016 00:45
WP - Only return posts in search
/**
* Search should only return posts
*/
function search_filter($query) {
if (!$query->is_admin && $query->is_search) {
$query->set('post_type', 'post');
// $query->set('post__not_in', array(1,5,10));
}
return $query;
}
@jmsmrgn
jmsmrgn / is-blog.php
Created January 24, 2016 00:43
WP - Blog view conditional check
/**
* Blog view conditional check
*/
function is_blog() {
return (is_author() || is_category() || is_tag() || is_date() || is_home() || is_single()) && 'post' == get_post_type();
}
@jmsmrgn
jmsmrgn / nice-search-redirect.php
Created January 24, 2016 00:43
WP - Pretty urls for search results
/**
* Pretty urls for search results
*/
function nice_search_redirect() {
global $wp_rewrite;
if (!isset($wp_rewrite) || !is_object( $wp_rewrite ) || !$wp_rewrite->using_permalinks())
return;
$search_base = $wp_rewrite->search_base;
@jmsmrgn
jmsmrgn / wp-add-pdf-filter.php
Created October 28, 2015 18:35
WP - Add pdf media type filter to media manager
/**
* Add pdf media type filter to media manager
*/
function modify_post_mime_types($post_mime_types) {
$post_mime_types['application/pdf'] = array(__('PDFs'), __('Manage PDFs'), _n_noop('PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>'));
return $post_mime_types;
}
add_filter( 'post_mime_types', 'modify_post_mime_types' );
@jmsmrgn
jmsmrgn / ie-10-css-hack.css
Created September 17, 2015 22:48
IE 10 css hack using -ms-high-contrast
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10-specific styles go here */
}