Skip to content

Instantly share code, notes, and snippets.

View kandros's full-sized avatar
:bowtie:
o.o

Jaga Santagostino kandros

:bowtie:
o.o
View GitHub Profile
@kandros
kandros / llm-wiki.md
Created August 27, 2026 12:11 — forked from ry/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.

import * as PgDrizzle from "@effect/sql-drizzle/Pg";
import { PgClient } from "@effect/sql-pg";
import { Config, Effect } from "effect";
import * as schema from "~/lib/server/schema";
const PgLive = PgClient.layerConfig({
url: Config.redacted("DATABASE_URL"),
});
export class DrizzleClient extends Effect.Service<DrizzleClient>()("app/DrizzleClient", {
// lib/server/sse/event-bus.ts
import { EventEmitter } from "events";
import { logger } from "~/lib/logger/logger";
interface SessionEvent {
type: string;
data: Object;
timestamp: string;
}
@kandros
kandros / typescriptreact.json
Created April 6, 2022 11:14
typescriptreact vscode snippets
{
"functional component": {
"prefix": ["func, fnc", "component", "fc", "func"],
"description": "react functional component",
"body": [
"import React from 'react'",
"type Props = {}",
"export const $TM_FILENAME_BASE: React.FC<Props> = () => {",
"\treturn (",
"\t\t<div>",
@kandros
kandros / Dockerfile
Created April 21, 2021 22:37
Fastify TypeScript Dockerfile
FROM node:14-alpine as builder
WORKDIR /app
ENV NODE_ENV=production
COPY package.json package-lock.json tsconfig.json ./
COPY src ./src
RUN npm ci --also=dev
RUN npm run build:ts
RUN npm prune --production
@kandros
kandros / .dockerignore
Last active December 17, 2020 09:10
Dockerfile for next.js projects
e2e
fixtures
*.test.*
node_modules
.next
.env
Dockerfile
.git
@kandros
kandros / _app.tsx
Created September 2, 2020 12:19
NextJS cognito cookie redirect to login
import { UserProvider } from "@app/context/user-context"
import "@app/styles/font.css"
import "@app/styles/global.css"
import "@app/styles/reset.css"
import { NextComponentType } from "next"
import App, { AppContext, AppInitialProps, AppProps } from "next/app"
import Head from "next/head"
import { parseCookies } from "nookies"
const CustomApp: NextComponentType<AppContext, AppInitialProps, AppProps> = ({ Component, pageProps }) => {
@kandros
kandros / gatsby-node.js
Created March 31, 2020 17:37
gatsby blog next prev
const path = require(`path`)
const { createFilePath } = require(`gatsby-source-filesystem`)
exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
const blogPost = path.resolve(`./src/templates/blog-post.js`)
const postsPromise = graphql(
`
{
document.addEventListener("keydown", e => {
if (e.key === "f") {
const btn = document.querySelector(
"#vjs_video_3 > div.playlist-arrow-button.hover-button"
);
btn.click();
} else if (e.code === "Space") {
e.preventDefault();
const video = document.querySelector("#vjs_video_3_html5_api");
@kandros
kandros / history
Last active July 3, 2019 12:06
Working Software
const paymentMachine = Machine({
id: 'payment',
initial: 'method',
states: {
method: {
initial: 'cash',
states: {
cash: { on: { SWITCH_CHECK: 'check' } },
check: { on: { SWITCH_CASH: 'cash' } },
hist: { type: 'history' }