Skip to content

Instantly share code, notes, and snippets.

View ragnraok's full-sized avatar
🎯
Focusing

RagnarokStack ragnraok

🎯
Focusing
View GitHub Profile
@ragnraok
ragnraok / llm-wiki.md
Created April 6, 2026 15:46 — 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.

@ragnraok
ragnraok / iframe-probe.py
Created September 9, 2019 07:24 — forked from alastairmccormack/iframe-probe.py
Shows GOP structure for video file using ffmpeg --show-frames output
#!/usr/bin/env python
#
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
#
# $ iframe-probe.py myvideo.mp4
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
@ragnraok
ragnraok / app.py
Created March 28, 2013 13:59
WeiTranslator.py 利用微信平台的开放接口写的一个通过调用google翻译的API进行翻译的小工具,还有一些彩蛋神码的。。。
# -*- coding: utf-8 -*-
from flask import Flask, request, make_response
from translator import google_translate
from moe_pic import get_pict
from douban_music import get_music
from logging.handlers import RotatingFileHandler
import libxml2
import time
import logging
@ragnraok
ragnraok / simpleHDR.py
Last active December 11, 2015 21:49
Simple HDR image filter implementation
import cv
import sys
input_img_name = sys.argv[1]
output_img_name = sys.argv[2]
input_img = cv.LoadImage(input_img_name, cv.CV_LOAD_IMAGE_COLOR)
# blur the image
dst = cv.CreateImage(cv.GetSize(input_img), input_img.depth, input_img.channels)
@ragnraok
ragnraok / signal_and_slot.py
Created October 30, 2012 06:03
PyQt4SingalAndSlot
# -*- coding: utf8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Form(QDialog):
def __init__(self, parent=None):