Skip to content

Instantly share code, notes, and snippets.

View kakopappa's full-sized avatar
🏠
Working from home

Aruna Tennakoon kakopappa

🏠
Working from home
View GitHub Profile
@kakopappa
kakopappa / llm-wiki.md
Created April 27, 2026 00:53 — 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.

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@kakopappa
kakopappa / claude-code-tools.md
Created August 28, 2025 04:45 — forked from wong2/claude-code-tools.md
Tools and system prompt of Claude Code

Task

Launch a new agent that has access to the following tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use the Agent tool to perform the search for you.

When to use the Agent tool:

  • If you are searching for a keyword like "config" or "logger", or for questions like "which file does X?", the Agent tool is strongly recommended

When NOT to use the Agent tool:

  • If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
  • If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
  • If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
@kakopappa
kakopappa / sinricpro-2-temp-sensor.ino
Last active February 16, 2025 06:03
SinricPro two temp sensors example
// Uncomment the following line to enable serial debug output
//#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#include <Arduino.h>
@kakopappa
kakopappa / SmartButton.h
Last active November 17, 2024 04:43
App push button for SinricPro
#ifndef _SMARTBUTTON_H_
#define _SMARTBUTTON_H_
#include <SinricProDevice.h>
#include <Capabilities/SmartButtonStateController.h>
class SmartButton
: public SinricProDevice
, public SmartButtonStateController<SmartButton> {
friend class SmartButtonStateController<SmartButton>;
@kakopappa
kakopappa / encryption.py
Created October 17, 2024 04:25
XSalsa20-Poly1305 Encryption Example
import nacl.utils
from nacl.public import PrivateKey, Box
from nacl.secret import SecretBox
import nacl.bindings
def generate_keypair():
private_key = PrivateKey.generate()
public_key = private_key.public_key
return private_key, public_key
@kakopappa
kakopappa / cat-feeder-esp32.ino
Created August 21, 2024 01:18
cat-feeder-esp32.ino
#include "freeRTOS\freeRTOS.h"
#include "freeRTOS\task.h"
#include <ESP32Servo.h>
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
@kakopappa
kakopappa / sinricpro-tv.ino
Last active May 31, 2024 06:12
sinricpro-tv
// #define ENABLE_DEBUG
#define SINRICPRO_NOSSL
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#include <Arduino.h>
@kakopappa
kakopappa / ChangeWiFI.ino
Created May 5, 2024 04:41
How to change the WIFI
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG_ESP_PORT Serial
#define NODEBUG_WEBSOCKETS
#define NDEBUG
#endif
#include <Arduino.h>
#if defined(ESP8266)
{
"name": "Water Level Indicator",
"description": "Water Level Indicator",
"deviceTypeId": "621b9648f728ec974aac62f2",
"capabilities": [
{
"id": "5ff0b45f994fd31b7d5e89c2",
"range": {
"instanceId": "rangeInstance1",
"locale": "en-US",