Skip to content

Instantly share code, notes, and snippets.

View vguhesan's full-sized avatar
💭
Greatest time in all of human history to be alive! Stay Thirsty, My Friend!

Venkatt Guhesan vguhesan

💭
Greatest time in all of human history to be alive! Stay Thirsty, My Friend!
View GitHub Profile

RAG Implementation Example

requires internet access and tools

A simple RAG system over a text document using LangChain, OpenAI for embeddings/LLM, and Chroma as the vector DB.

Prerequisites

Install packages

@vguhesan
vguhesan / README.md
Created February 16, 2026 03:31
RAG Impl no internet access, locally running model

How to run

  1. Make sure Ollama is running with llama3: ollama pull llama3 && ollama run llama3
  2. Have SingleStore running locally (Docker example): docker run -d -p 3306:3306 --name singlestore singlestore/cluster-in-a-box (create the database rag_db manually or let the script handle it)
  3. Install dependencies (once):Bash
pip install llama-index llama-index-embeddings-ollama llama-index-llms-ollama llama-index-vector-stores-singlestore singlestoredb
  4. Update the CONFIGURATION section with your paths/credentials.
  5. python rag_pipeline.py
@vguhesan
vguhesan / gist:0720251db8dc60a19a9d389a38b7a860
Created February 16, 2026 01:31
TamperMonkey / UserScripts for widening teh Grok results panel
// ==UserScript==
// @name Grok Wide Output Results Panel
// @namespace http://digitalriver.blog/grok-wide-output
// @version 2026-02-16
// @description Makes the Grok Results Output be wider
// @author Venkatt Guhesan
// @match https://grok.com/
// @icon https://grok.com/images/favicon.ico
// @grant none
// ==/UserScript==
@vguhesan
vguhesan / gist:9218edc81ba233bced88f0fe406f1ad0
Created February 16, 2026 01:30
Widen Grok Results Panel
// Run me in a developer JavaScript Console
// Need to place this in a TamperMonkey UserScripts soon
var targetElem = document.querySelector('html > body > div:nth-of-type(2) > div:nth-of-type(2) > div > div > main > div:nth-of-type(2)');
targetElem.style.setProperty("--content-max-width", "70rem");
@vguhesan
vguhesan / gist:b0e39e3ffa5744ade12c87a367833a7d
Created June 1, 2025 16:22
Prune / Remove all contents of node-modules directory in all subdirectories below current working directory
#!/bin/bash
# Delete all node_modules directories recursively
find . -type d -name "node_modules" -print0 | xargs -0 rm -rf
echo "All node_modules directories deleted."
@vguhesan
vguhesan / gist:db179f07fc41925c7286bed2ecf255bc
Created June 1, 2025 16:20
Space used in current directory
du -sh * | sort -h | tail -n 10
@vguhesan
vguhesan / qrc.sh
Created September 9, 2024 20:36
Generate qrcode of a url and display it in an Edge browser on Windows
#!/usr/bin/env bash
# qrc.sh
# Generate qrcode of a url and display it in an Edge browser on Windows
# This script depends on https://github.com/skip2/go-qrcode
# Debug Options
# Toggle the echo variable assignment to either ":" (nop) or "echo"
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
// Get Working Directory
@vguhesan
vguhesan / hugo-figure-tag
Last active June 3, 2020 02:53
Hugo Static Generator - figure tag - with proper crediting inline. Useful for someone using the figure tag in Hugo Static Generator.
{{<figure src="/img/2020/06/02/fabian-grohs-XMFZqrGyV-Q-unsplash.jpg" caption="Photo by <a href='https://unsplash.com/@grohsfabian?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText' target='_blank'>Fabian Grohs</a> on <a href='https://unsplash.com/s/photos/programming?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText' target='_blank'>Unsplash</a>" class="aligncenter round-img-border imgframe-left-pad" >}}
@vguhesan
vguhesan / humanize.md
Last active October 25, 2023 03:39
Python Humanize timedelta without Arrow or Humanize library

Python Humanize timedelta without Arrow or Humanize library

Given 2 dates that are formatted from a string to arrow type.

>>> from datetime import datetime 
>>> start = datetime.now()
>>> end = datetime.now()
>>> diff = end - start