Skip to content

Instantly share code, notes, and snippets.

View truedat101's full-sized avatar
💭
vr / ai / iot

David J. Kordsmeier truedat101

💭
vr / ai / iot
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.

"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@agrancini-sc
agrancini-sc / VideoStreamingWithSupabase.ts
Created December 4, 2025 21:43
VideoStreamingWithSupabase
import { RectangleButton } from 'SpectaclesUIKit.lspkg/Scripts/Components/Button/RectangleButton';
import { SnapCloudRequirements } from './SnapCloudRequirements';
/**
* VideoStreamingController - Live video streaming to Supabase Realtime for real-time viewing
* Based on Remote ARsistance pattern - streams frames for live viewing, no storage
*
* KEY DIFFERENCE from VideoCaptureUploader:
* - This STREAMS for live viewing (no file storage)
* - VideoCaptureUploader UPLOADS for video composition (stores files)

How to run Multiple Claude Code Accounts

Run two Claude Code accounts simultaneously on your computer without re-authenticating by using separate configuration directories.

Notes

  • Requires separate Anthropic accounts (different emails).
  • Update Claude Code: npm install -g @anthropic-ai/claude-code.
  • If re-authentication occurs, verify CLAUDE_CONFIG_DIR with echo $CLAUDE_CONFIG_DIR.
@Matt54
Matt54 / ModelIOLoader.swift
Last active October 14, 2025 07:33
PLY to RealityKit with Grid-Based Decimation (Example: HD Skeleton Scan)
import Foundation
import ModelIO
import simd
nonisolated func loadMeshWithModelIO(from url: URL) throws -> TriangleMesh {
let asset = MDLAsset(url: url)
guard asset.count > 0 else {
throw NSError(domain: "ModelIO", code: 1, userInfo: [NSLocalizedDescriptionKey: "No objects found in file"])
}
@Matt54
Matt54 / BranchSegment.swift
Last active July 12, 2025 08:30
RealityKit Growing/Shrinking Branch using LowLevelMesh
import Foundation
struct BranchSegment {
var startPosition: SIMD3<Float>
var endPosition: SIMD3<Float>
var radius: Float
init(startPosition: SIMD3<Float>, endPosition: SIMD3<Float>, radius: Float) {
self.startPosition = startPosition
self.endPosition = endPosition
@Matt54
Matt54 / MorphingSpherePlaneParams.h
Last active June 22, 2025 01:04
RealityKit LowLevelMesh Sphere to Rectangular Plane Morph with Metal Compute Shader
#ifndef MorphingSpherePlaneParams_h
#define MorphingSpherePlaneParams_h
struct MorphingSpherePlaneParams {
int latitudeBands;
int longitudeBands;
float radius;
float morphAmount;
};
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
/**
* Enhanced 3D Line component with smooth spline interpolation
* Creates a 3D tube by extruding a circular cross-section along a path defined by scene objects.
*/
@component
@agrancini-sc
agrancini-sc / Spline from Line Render
Created May 28, 2025 23:07
Spline from Line Render
import {
withAlpha,
withoutAlpha,
} from "SpectaclesInteractionKit.lspkg/Utils/color";
import InteractorLineRenderer, {
VisualStyle,
} from "SpectaclesInteractionKit.lspkg/Components/Interaction/InteractorLineVisual/InteractorLineRenderer";
/**
* This class provides visual representation for a spline curve through a series of control points.
@agrancini-sc
agrancini-sc / DirectionalShadow.ts
Created April 23, 2025 16:00
Directional Shadow
// Import required modules
const WorldQueryModule = require("LensStudio:WorldQueryModule");
const EPSILON = 0.01;
/**
* DirectionalWorldQuery
*
* A utility that performs world queries in a direction defined by two scene objects.
* It can then project rays from a third object in that same direction.