Skip to content

Instantly share code, notes, and snippets.

View ndamulelonemakh's full-sized avatar
🍸
Solution explorer

Ndamulelo Nemakhavhani ndamulelonemakh

🍸
Solution explorer
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.

@ndamulelonemakh
ndamulelonemakh / planning_orchestrator.py
Last active June 19, 2025 11:13
Multi-agent LLM orchestration patterns
import random
# -------------------------------
# Simulated Agent Tools
# -------------------------------
class ResearchAgent:
def run(self, topic, sources_required=3):
print(f"[ResearchAgent] Researching: {topic} (need {sources_required} sources)")
return f"Research data about {topic} from {sources_required} sources"
@ndamulelonemakh
ndamulelonemakh / api_gateway.conf
Created December 24, 2024 11:47 — forked from nginx-gists/api_gateway.conf
Deploying NGINX Plus as an API Gateway, Part 2: Protecting Backend Services
include api_backends.conf;
include api_keys.conf;
limit_req_zone $binary_remote_addr zone=client_ip_10rs:1m rate=1r/s;
limit_req_zone $http_apikey zone=apikey_200rs:1m rate=200r/s;
server {
access_log /var/log/nginx/api_access.log main; # Each API may also log to a
# separate file
@ndamulelonemakh
ndamulelonemakh / push-github-docker.sh
Last active October 13, 2024 11:14
Convenience script to push images to Github container registry
#!/bin/bash
set -e
# Pre-requisite:
# Generate your token at: https://github.com/settings/tokens/new?scopes=write:packages
# More info: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
export CR_PAT=<YOUR_TOKEN>
GITHUB_USERNAME=<your-github-account-name>
echo $CR_PAT | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
@ndamulelonemakh
ndamulelonemakh / Dockerfile.Angular
Created May 23, 2024 21:28
Sample docker file for running angular 17+ with ssr support
FROM node:lts-alpine as build
WORKDIR /app
COPY package*.json ./
# Install dependencies
RUN npm ci --force
COPY . .
# Official reference: https://swagger.io/specification/
openapi: "3.0.0" # The version of the OpenAPI Specification being used
info: # Metadata about the API
version: "1.0.0" # Version of the API
title: "Sample API" # Name of the API
servers: # Base URL and other server information
- url: "http://api.example.com/v1"
@ndamulelonemakh
ndamulelonemakh / app.py
Created May 11, 2024 16:35
Flask server html
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
todos = []
@app.route('/')
def index():
return render_template('index.html', todos=todos)
@app.route('/add', methods=['POST'])
@ndamulelonemakh
ndamulelonemakh / pdf_preview.html
Created November 14, 2023 11:16
HTML Snippets - less JS, less npm install
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Native HTML PDF Preview</title>
</head>
<body>
<div style="display: block; height: 900px; background-color: aqua;">
<object
@ndamulelonemakh
ndamulelonemakh / git-line-endings-config.md
Last active February 7, 2024 08:35
Handle CRLF and LF settings when working on Windows and Linux environments

Handling Line Endings: Windows, WSL2, and Ubuntu

When working on different operating systems, managing line endings is crucial to ensure consistency and avoid issues in a collaborative development environment. Here are the recommendations for configuring Git to handle line endings on Windows, WSL2, and Ubuntu:

1. Windows:

  • Recommended Setting: core.autocrlf true
  • Command:
    git config --global core.autocrlf true