Skip to content

Instantly share code, notes, and snippets.

View sfines's full-sized avatar

Steven Fines sfines

View GitHub Profile
@sfines
sfines / llm-wiki.md
Created May 17, 2026 07:33 — 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.

@sfines
sfines / ADTMacros.scala
Last active July 16, 2019 18:32 — forked from trbngr/ADTMacros.scala
DynamoFormats for ADT
package com.company.macros
import scala.reflect.macros.blackbox
class ADTMacros(val c: blackbox.Context) {
import c.universe._
def dynamoFormat[T: c.WeakTypeTag]: Tree = {
generate[T] { (tpe, symbols) =>
@sfines
sfines / addNewData.R
Created November 6, 2016 21:07 — forked from dfalster/addNewData.R
The function addNewData.R modifies a data frame with a lookup table. This is useful where you want to supplement data loaded from file with other data, e.g. to add details, change treatment names, or similar. The function readNewData is also included. This function runs some checks on the new table to ensure it has correct variable names and val…
##' Modifies 'data' by adding new values supplied in newDataFileName
##'
##' newDataFileName is expected to have columns
##' c(lookupVariable,lookupValue,newVariable,newValue,source)
##'
##' Within the column 'newVariable', replace values that
##' match 'lookupValue' within column 'lookupVariable' with the value
##' newValue'. If 'lookupVariable' is NA, then replace *all* elements
##' of 'newVariable' with the value 'newValue'.
##'
package com.example.core.application
import com.mongodb.casbah.Imports._
import java.util.UUID
import com.example.domain.{User, Address, Customer}
/**
* Contains type classes that deserialize records from Casbah into "our" types.
*/
trait CasbahDeserializers {
@sfines
sfines / JBOSS-Text.txt
Created August 10, 2011 00:35
JBoss AS deployment error -
2011-08-09 17:24:09,591 ERROR [org.apache.catalina.core.StandardContext] (HDScanner) Context [/notification-services] startup failed due to previous errors
java.lang.RuntimeException: mapped-name is required for java:/notificationDb of deployment notification-services.war
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceRefs(WebResourceHandler.java:178)
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:327)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:537)
at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:158)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4272)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDe