Skip to content

Instantly share code, notes, and snippets.

View miguelrk's full-sized avatar

miguelrk

View GitHub Profile

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.

@izakfilmalter
izakfilmalter / useFilterQuery.tsx
Last active June 4, 2025 11:42
Zero + bazza/ui filters
import type { FiltersState } from '@/components/data-table-filter/core/types'
import { filtersSchema } from '@/components/data-table-filter/core/types'
import type { FilterKeys } from '@/data/globalState'
import { noOp } from '@/shared/things'
import { useZero } from '@/shared/zero/useZero'
import type { ZSchema } from '@/shared/zero/zeroSchema.mjs'
import { escapeLike, type Query, type TTL } from '@rocicorp/zero'
import { useQuery } from '@rocicorp/zero/react'
import { getTime } from 'date-fns/fp'
import { Array, Boolean, Option, pipe, String } from 'effect'
@marvinhagemeister
marvinhagemeister / bind-plugin.ts
Last active June 8, 2025 06:48
Preact Signals `bind:value`
import { options } from "preact";
import { Signal } from "@preact/signals";
// Add `bind:value` to JSX types
declare global {
namespace preact.createElement.JSX {
interface HTMLAttributes {
"bind:value"?: Signal<string | string[] | number | undefined>;
}
}
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active July 31, 2025 20:51
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@danielpeintner
danielpeintner / example-client.js
Last active November 2, 2022 07:46
node-wot (basic authentication)
// example-client.js
Servient = require("@node-wot/core").Servient
HttpClientFactory = require("@node-wot/binding-http").HttpClientFactory
Helpers = require("@node-wot/core").Helpers
// create Servient and add HTTP binding
let servient = new Servient();
servient.addCredentials({
"urn:dev:wot:org:eclipse:thingweb:my-example-secure": {