Skip to content

Instantly share code, notes, and snippets.

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.

@jhwohlgemuth
jhwohlgemuth / Format-BookmarkExport.ps1
Created March 23, 2025 02:34
Ingest and transform Firefox bookmarks export JSON file
function Invoke-Shape() {
Param(
[Parameter(Position = 0, ValueFromPipeline = $True)]
[object] $Data,
[Switch] $Recursive
)
Begin {
function Remove-Attribute() {
Param(
[Parameter(Position = 0, ValueFromPipeline = $True)]
@jnpbl79
jnpbl79 / Flatten-JsonToEnv.ps1
Last active November 19, 2026 18:43
Flattens a JSON file into environment variable format.
function Flatten-JsonToEnv {
<#
.SYNOPSIS
Flattens a JSON file into environment variable format.
.DESCRIPTION
This function takes a JSON file and flattens its structure into a format suitable for environment variables.
It supports nested objects and arrays, using a specified separator to denote hierarchy. The output can be
returned as a hashtable, an array of objects, or a JSON string.
.PARAMETER JsonFilePath
The path to the JSON file to be flattened.
@RobyOne77
RobyOne77 / make_XML_for_MKV..md
Last active November 19, 2026 18:43
Make XML MKV's tags file from JSON

MKV is said to be a very complex video container and consequently tag management is equally complex. Instead, in my opinion, simple things are made complex by a system that is too brainy. Potentially complex and detailed structures can be made, but that fails in the simple and often most used things. The system of populating tags in MKV is done using an XML file that can be passed to various tools in the mkvtoolnix package. Nice ... but really? The only descriptive tag I can set from the command line or GUI is the Title. You want to insert a comment or any other field, you have to inject an XML that follows very precise rules. Since creating this XML for me is torture, I decided to create this script in powershell that allows you to take a JSON file, definitely less complex to compile and get an XML ready to inject into the MKV.

A couple of examples follow to retrieve tags from an existing MKV, modify it, and re-inject it.

MKV allows tags to be inserted at various levels: global, all, and track level. My s

@pferreirafabricio
pferreirafabricio / ConvertGitLogToJson.ps1
Created October 26, 2022 20:33
Powershell script to convert git logs in JSON
# Credits: https://stackoverflow.com/a/49515414/12542704
$header = @("commit", "tree", "parent", "refs", "subject", "body", "author", "commiter")
[string] $gitLogs = (git --no-pager log -n 10 --no-merges --pretty=format:'%H|%T|%P|%D|%s|%b|%an|%cn;')
$replacedArray = $gitLogs.Replace("; ", ';') -split ";", 0, "multiline";
$handledLogs = foreach ($commit in $replacedArray) {
$prop = $commit -split "\|"
$hash = [ordered]@{}
@sliptrixx
sliptrixx / generate.ps1
Created February 21, 2024 06:55
PowerShell Script for generating rust-project.json
<#
MIT License
Copyright (c) 2024 Hibnu Hishath
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@byroot
byroot / rack.rb
Created November 18, 2026 23:45
require "rack/multipart"
# Multipart form-data allow to send strings in arbitrary encodings.
# By itself it's not so much of a problem, but it's not rare for code
# not to handle this so well (see Trilogy injection vuln),
# and there's not really legitimate use for it, so it's preferable
# to not allow any encoding other than BINARY and UTF-8.
# ASCII is turned into UTF-8 for simplicty.
# Some version of this patch will very likely make it into Rack 3.3
# and be the default behavior in 4.0.
@josy1024
josy1024 / Get-ConfigurationfromJSON.ps1
Created November 8, 2023 23:25
simple get-configuration from json array (file)
function Get-ConfigurationfromJSON {
<#
.SYNOPSIS
json array config file
.DESCRIPTION
use a json config file
.EXAMPLE
# $config = Get-Configuration -match "2" -config .\mandant.json
# $config.ConfigValue
#>
@Raukze
Raukze / contact-sensor-left-open-notification.yaml
Last active November 19, 2026 18:36
Home Assistant Blueprint: Contact Sensor Left Open Notification
blueprint:
name: πŸšͺ Contact Sensor Left Open Notification by Malte
description: |
πŸ“² Notifies you when a door or window is left open.
πŸš€ Version 2024.04.23.1
Are you tired of worrying about open doors or windows? This blueprint has got you covered! It's designed to send you a prompt notification when a door or window remains open for a specified duration.
πŸ“– For Details see this [Blog post](https://community.home-assistant.io/t/contact-sensor-door-or-window-left-open-notification/652571)
@Harold2017
Harold2017 / compile-commends.ps1
Created October 7, 2026 09:50
generate compile_commands.json from cmake + msvc
<#
.SYNOPSIS
Writes compile_commands.json for clangd / clang-tidy from a CMake build that cannot export one itself.
.DESCRIPTION
The Visual Studio generator ignores CMAKE_EXPORT_COMPILE_COMMANDS, so the compile commands are read from
CMake's file API instead - the codemodel reply, the same data the CMake Tools extension uses. Every
source compiled from this repository gets one entry with the flags of the selected configuration.
Nothing is compiled; the configure step is only repeated so that the model is up to date (skip it with
-NoConfigure once the build directory is configured and no CMake file changed).