Skip to content

Instantly share code, notes, and snippets.

View rodrigoalvesvieira's full-sized avatar
📚

Rodrigo Alves Vieira rodrigoalvesvieira

📚
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.

#include <stdio.h>
/*
Rodrigo Alves @ CIn - rav2
cin.ufpe.br/~rav2
Assuming you have downloaded both the C++ and the input file,
to run this software open your computer's console and run:
g++ -o chinese.out chinese.cpp && ./chinese.out
#include <stdio.h>
int recursion(int n)
{
if (n == 1) return 7;
return recursion(n-1) + 5;
}
int main()
{
import java.util.Scanner;
/**
* The contents of this file are not directly bound to a normal Algorithms class
* Here I plan to store some known Algorithms that represent proven Mathematical formulas
* for computing calculations that may appear in my programming assignments
*
* @author Rodrigo Alves
*
*/
res = ""
("a".."z").to_a.each do |l|
res << "'#{l}'" << ", "
end
puts res
#include <iostream>
#include <stdexcept>
using namespace std;
int divide(int A, int B);
int main()
{
int A, B;
cout << "Welcome do the marvelous divider!\n" << endl << endl;
@rodrigoalvesvieira
rodrigoalvesvieira / BFS.cpp
Created August 4, 2013 02:31
Simple implementation of a BFS https://en.wikipedia.org/wiki/Breadth-first_search https://upload.wikimedia.org/wikipedia/commons/3/33/Breadth-first-tree.svg Time complexity is O(|V| + |E|). According to Wikipedia O(|E|) may vary from O(|V|) to O(|V|^2).
// BFS - Breadth First Search
// author: Rodrigo Alves
// As explained on Wikipedia https://en.wikipedia.org/wiki/Breadth-first_search
#include <cstdio>
#define Mark(A, pos) (A[pos] = 1)
class Node {
public:
int value;
Node* next;
// a jquery script to fetch all acronyms from political parties in Brazil from the following url
// http://pt.wikipedia.org/wiki/Anexo:Lista_de_partidos_pol%C3%ADticos_no_Brasil
// July 1, 2013
var base = 1;
var count = 29;
var total = "";
while (count > 0) {
total += $(".wikitable.sortable.jquery-tablesorter tbody tr td").eq(base).text();
@rodrigoalvesvieira
rodrigoalvesvieira / concat-images.rb
Last active October 23, 2018 13:11
Concatenate multiple images into one using ImageMagick and Ruby
#!/usr/bin/env ruby
=begin
Rodrigo Alves
Februrary 26, 2013
A program to concatenate multiple images into one
Call it from the command line and pass it n parameters, the first n-1 parameters
are the names of the images from which you wanna create another image and the n-th