Skip to content

Instantly share code, notes, and snippets.

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.

@jamtur01
jamtur01 / riemann.config
Last active September 10, 2016 16:08
Example of Riemann index lookup a la Nagios Herald
(require 'riemann.common)
(require 'clojure.pprint)
(let [host "0.0.0.0"]
(graphite-server :host host
:port 5559)
(tcp-server :host host)
(udp-server :host host
:max-size 65000)
(repl-server :host host)
@clarkdave
clarkdave / logstash-sentry.rb
Last active May 15, 2023 11:34
(Logstash) Sentry output plugin
# The MIT License (MIT)
# Copyright (c) 2014 Dave Clark
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ILoGM
ILoGM / migrator_monkey_patch.rb
Created April 15, 2014 12:06
This patch allows disable ddl transactions in Rails 3.2
class ActiveRecord::Migrator
def migrate(&block)
current = migrations.detect { |m| m.version == current_version }
target = migrations.detect { |m| m.version == @target_version }
if target.nil? && @target_version && @target_version > 0
raise UnknownMigrationVersionError.new(@target_version)
end
start = up? ? 0 : (migrations.index(current) || 0)
@niquola
niquola / DCI Context
Created July 10, 2013 15:47
Hangout Model Layer
class SignPendingOrdersService
def initialize(visit, user) # service context
@visit, @user = visit, user
end
def call # or execute
Order.for_visit(visit).pendings.each do |order|
order.activate!
OrderTemplate.find_or_create_template_for_order_and_record_template_usage!(order)
end
@niquola
niquola / strong_concern.rb
Created July 8, 2013 22:53
Strong Concern (explicit manage concern dependencies both ways)
# naive implementation
class TwoWayDelegate
attr :_subject
def initialize(subject)
@_subject = subject
end
def inspect
"TwoWayDelegate <#{methods.sort}>"
end
@teropa
teropa / resources.md
Last active December 4, 2020 05:42
Clojure Resources

Tutorials

var Comments = Backbone.Collection.extend({
url: function() {
return this.baseUrl + '/comments';
},
initialize: function(bootstrapData, options) {
this.baseUrl = options.baseUrl;
}
}),
Posts = Backbone.Collection.extend({
@savonarola
savonarola / benchmark.txt
Last active December 11, 2015 14:08
Отгрузка списка ~200 небольших записей такого вида: rails g scaffold Post title body:text. Работа с бд в обоих случаях заняла пренебрежимо мало
1.9.3-p194-perf, rails, 10 unicorns
>siege -r 200 -c 10 -d 0 'http://localhost:9080/posts'
** SIEGE 2.72
** Preparing 10 concurrent users for battle.
The server is now under siege.. done.
Transactions: 2000 hits
Availability: 100.00 %
Elapsed time: 117.59 secs
@solnic
solnic / rvm_remove_old.sh
Created December 4, 2012 09:34
Remove all rubies older than given date
DATE=2012-06-01
for version in `find $rvm_path/rubies/ -mindepth 1 -maxdepth 1 -type d -not -newermt $DATE | cut -d / -f 7`; do rvm remove $version; done