Skip to content

Instantly share code, notes, and snippets.

View wilsonfreitas's full-sized avatar

Wilson Freitas wilsonfreitas

View GitHub Profile
@wilsonfreitas
wilsonfreitas / llm-wiki.md
Created April 15, 2026 23:17 — 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.

@wilsonfreitas
wilsonfreitas / lru_cache.py
Created September 20, 2022 13:25 — forked from hughdbrown/lru_cache.py
Minimal lru_cache implementation for python 2.7
from functools import wraps
try:
from functools import lru_cache
except ImportError:
def lru_cache(user_function):
cache = {}
@wraps(user_function)
def wrapper(*args):
key = tuple(args)
@wilsonfreitas
wilsonfreitas / ft_gif.R
Created August 7, 2022 21:47 — forked from Athospd/ft_gif.R
Como gerar GIF com animação com R
f <- function(x) cos(x*20)
expi <- function(x) cos(x) + sin(x)*1i
par(mfrow = c(1,2))
L <- 40
medias_Re <- c()
fs <- c()
as <- seq(0.01, 1, l = 140)
animation::saveGIF({
for(a in as) {
@wilsonfreitas
wilsonfreitas / book_recs.md
Created June 10, 2020 11:26
Books I've used in class or found through other channels; spans Python, R, Java, C, C++, Finance, Data Science:

Machine Learning and AI for Finance

Advances in Financial Machine Learning, de Prado: http://www.quantresearch.org/
Machine Learning for Asset Managers, de Prado
Machine Learning for Factor Investing, Guida: http://www.mlfactor.com/
Big Data and Machine Learning in Quantitative Investment, Guida
Artificial Intelligence in Finance, Hilpisch: https://home.tpq.io/

Trading Analytics and Algorithms

Python for Finance 2d ed, Hilpisch
Derivatives Analytics with Python, Hilpisch

@wilsonfreitas
wilsonfreitas / cpf_consulta_api_sus.py
Created December 9, 2016 08:07 — forked from jh00nbr/cpf_consulta_api_sus.py
Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests,json,sys
# Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
# Jhonathan Davi A.K.A jh00nbr / Insightl4b lab.insightsecurity.com.br
# Blog: lab.insightsecurity.com.br
# Github: github.com/jh00nbr
# Twitter @jh00nbr