Skip to content

Instantly share code, notes, and snippets.

View andreagalle's full-sized avatar
💭
Whatever Works - Basta che funzioni

Andrea Gallegati andreagalle

💭
Whatever Works - Basta che funzioni
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.

@andreagalle
andreagalle / pipfreeze
Created October 30, 2023 09:40 — forked from david-wm-sanders/pipfreeze
Powershell Command to pip freeze properly
.\venv\Scripts\pip freeze | Out-File -Encoding UTF8 requirements.txt
@andreagalle
andreagalle / PasswordEncryption.java
Created October 4, 2021 22:55 — forked from danieljs777/PasswordEncryption.java
Encryting passwords with MD5 hash and salt in Java.
package PasswordEncryption;
/**
*
* @author daniel
*/
import java.io.Console;
import java.io.IOException;
import java.security.*;
import java.io.ByteArrayOutputStream;
@andreagalle
andreagalle / git-subtrees.md
Created June 9, 2020 15:47 — forked from tdd/git-subtrees.md
Subtrees investigations

Workbench

We extract our test repos from this small Zip file.

  • main is a "container" repository with its working copy,
  • plugin is a "shared" repository with its working copy,
  • remotes emulates remote bare repos for both, to better resemble regular usage.

The idea is to use plugin as a subtree of main in a vendor/plugins/demo path, and allow maintenance both ways:

@andreagalle
andreagalle / README-Template.md
Created February 25, 2020 19:03 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@andreagalle
andreagalle / .vimrc
Created September 29, 2019 09:00 — forked from Sharpie/.vimrc
A vim profile file designed for editing Fortran source code
" Ensure correct syntax highlighting and auto-indentation for Fortran free-form
" source code.
let fortran_free_source=1
let fortran_do_enddo=1
filetype plugin indent on
syntax on
" Turn on line numbers and row/column numbers.
set nu
@andreagalle
andreagalle / vtk-unstructured-grid-plot.py
Created May 10, 2019 07:33 — forked from mrklein/vtk-unstructured-grid-plot.py
Read, cut and plot VTK file with python-vtk and matplotlib
%matplotlib inline
filename = 'vtk-plot_0.vtk'
import vtk
from numpy import zeros
import matplotlib.pyplot as plt
reader = vtk.vtkUnstructuredGridReader()
reader.SetFileName(filename)
@andreagalle
andreagalle / pre-push.sh
Created May 7, 2019 13:12 — forked from vlucas/pre-push.sh
Prevent Pushes Directly to Master
#!/bin/bash
# @link https://gist.github.com/mattscilipoti/8424018
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...