Skip to content

Instantly share code, notes, and snippets.

@rintcius
rintcius / llm-wiki.md
Created April 9, 2026 18:29 — 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.

@rintcius
rintcius / postgres driver issue.txt
Created January 10, 2020 19:38
Issue with "org.postgresql" % "postgresql" % "42.2.9"
[error] ! roundtrip DateTimeInterval (86 ms)
[error] org.postgresql.util.PSQLException: Failed to create object for: interval. (PgConnection.java:646)
[error] org.postgresql.jdbc.PgConnection.getObject(PgConnection.java:646)
[error] org.postgresql.jdbc.PgResultSet.getObject(PgResultSet.java:2594)
[error] doobie.util.Get$Advanced$.$anonfun$other$1(get.scala:157)
[error] doobie.util.Get$Advanced$.$anonfun$other$1$adapted(get.scala:156)
[error] doobie.util.Get.unsafeGetNonNullable(get.scala:30)
[error] doobie.util.Read$.$anonfun$fromGet$1(read.scala:75)
[error] doobie.util.Read$.$anonfun$fromGet$1$adapted(read.scala:75)
[error] doobie.util.LowerPriorityRead.$anonfun$product$1(read.scala:99)
{ "num": 1, "foo": 11 }
{ "num": 2, "foo": 1.12345 }
{ "num": 3, "foo": "13" }
{ "num": 4, "foo": "zap" }
{ "num": 5, "foo": true }
{ "num": 6, "foo": false }
{ "num": 7, "foo": null }
{ "num": 8, "foo": { "$offsetdatetime": "2009-02-13T23:31:30.011+12:15:18" } }
{ "num": 9, "foo": { "$offsetdate": "2009-02-13+12:15:18" } }
{ "num": 10, "foo": { "$offsettime": "23:31:30.011+12:15:18" } }
-- ok
x1 :: Int
x1 = y
where
z = 42
(y :: Int) = z
-- ok
x2 :: Int
x2 = y
Unexpected error: java.io.IOException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
com.fasterxml.jackson.dataformat.xml.util.StaxUtil.throwXmlAsIOException(StaxUtil.java:24)
com.fasterxml.jackson.dataformat.xml.XmlFactory._createParser(XmlFactory.java:561)
com.fasterxml.jackson.dataformat.xml.XmlFactory.createParser(XmlFactory.java:433)
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2896)
com.microsoft.rest.v2.serializer.JacksonAdapter.deserialize(JacksonAdapter.java:126)
com.microsoft.rest.v2.protocol.HttpResponseDecoder.deserializeBody(HttpResponseDecoder.java:139)
com.microsoft.rest.v2.protocol.HttpResponseDecoder.access$100(HttpResponseDecoder.java:42)
com.microsoft.rest.v2.protocol.HttpResponseDecoder$2.apply(HttpResponseDecoder.java:119)
/*
* Copyright 2014–2018 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
def toNumber: Slice = {
def setNum(nc: ArrayNumColumn, i: Int, s: String): Unit =
try {
val n = BigDecimal(s)
nc.update(i, n)
} catch {
case _: NumberFormatException =>
// don't set anything
}
foundation (configurations compile, compile-internal, optional, provided, runtime, runtime-internal, test, test-internal)
├─ co.fs2:fs2-core_2.12:0.10.5
│ ├─ org.scala-lang:scala-library:2.12.4
│ ├─ org.typelevel:cats-core_2.12:1.1.0
│ │ ├─ org.scala-lang:scala-library:2.12.4
│ │ ├─ org.typelevel:cats-kernel_2.12:1.1.0
│ │ │ └─ org.scala-lang:scala-library:2.12.4
│ │ ├─ org.typelevel:cats-macros_2.12:1.1.0
│ │ │ ├─ org.scala-lang:scala-library:2.12.4
│ │ │ └─ org.typelevel:machinist_2.12:0.6.2
This file has been truncated, but you can view the full file.
root (configurations compile, compile-internal, optional, provided, runtime, runtime-internal, test, test-internal)
└─ org.scala-lang:scala-library:2.12.4
foundation (configurations compile, compile-internal, optional, provided, runtime, runtime-internal, test, test-internal)
├─ co.fs2:fs2-core_2.12:0.10.5
│ ├─ org.scala-lang:scala-library:2.12.4
│ ├─ org.typelevel:cats-core_2.12:1.1.0
│ │ ├─ org.scala-lang:scala-library:2.12.4
│ │ ├─ org.typelevel:cats-kernel_2.12:1.1.0
│ │ │ └─ org.scala-lang:scala-library:2.12.4
│ │ ├─ org.typelevel:cats-macros_2.12:1.1.0
log4j:ERROR A "org.apache.log4j.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [URLClassLoader with NativeCopyLoader with RawResources(
urls = List(<HUGE CLASSPATH>),
parent = java.net.URLClassLoader@5ff54593,
resourceMap = Set(app.class.path, boot.class.path),
nativeTemp = /var/folders/xr/n2y8hqw16c31gxwt5fm6vw580000gn/T/sbt_ef9b0033
)] whereas object of type
log4j:ERROR "org.apache.log4j.FileAppender" was loaded by [URLClassLoader with NativeCopyLoader with RawResources(
urls = List(<HUGE CLASSPATH>),