Skip to content

Instantly share code, notes, and snippets.

View thistleknot's full-sized avatar

Turning out data tricks since 2006! thistleknot

View GitHub Profile
@thistleknot
thistleknot / autonomous sw development crystal.md
Created May 17, 2026 15:48
autonomous sw development crystal.md
---

**Question:** What are the durable, reusable principles for making AI coding agents actually perform — and what are the failure modes they solve?

---

Findings

Core claim: The failure mode is not the model — it's the workflow. Treating an LLM as a chatbot invites non-deterministic sprawl. Treating it as a compiler collapses that into a single valid path.

AGON: AN ANCIENT GREECE ROLEPLAYING GAME

Based on Microlite20 / PathfinderLITE core rules by Morgan Mains


"In the beginning was Chaos, then Gaia, then the gods, then the heroes — and then, at last, the players."

This game is a trimmed-down d20 system adapted for the world of ancient Greece: its city-states, its gods, its monsters, its philosophy. The Aegean is a world where fate is real, where hubris kills, where a man may wrestle a god and win — or lose everything trying.

Three books follow. Book I is the Players Compendium. Book II is the Campaign Guide for the Strategos (Game Master). Book III is a starter dungeon crawl in the Red Book tradition.

@thistleknot
thistleknot / Multi-hop_kg_prompt.md
Last active March 21, 2026 01:53
Multi hop kg prompt

To prime multihop reasoning, think how to expand the above query/conversation/article as if a KG subgraph and then query an imaginary relevant kg, then traverse the retrieved subgraph to expand upon, then query (web search) and respond

@thistleknot
thistleknot / Agentic Memory.md
Created January 26, 2026 00:43
Agentic Memory.md

Agentic Memory Approaches: Comprehensive Taxonomy

Executive Summary

This document synthesizes research across 10 major agentic memory architectures, providing implementation details, performance benchmarks, and comparative analysis for production deployment.


Table of Contents

@thistleknot
thistleknot / cross_encoder.py
Created November 30, 2025 02:00
cross encoder
from sentence_transformers import CrossEncoder
MODEL_NAME = 'cross-encoder/ms-marco-MiniLM-L12-v2'
nli_model = CrossEncoder(MODEL_NAME)
m2v_model = distill(model_name=MODEL_NAME)
query = "Explain quantum computing"
# Generate SAPO response group
responses = [
@thistleknot
thistleknot / states.csv
Last active January 1, 2026 05:30
states
States Poverty Infant Mort White Crime Doctors Traf Deaths University Unemployed Income Population LTUne
Alabama 15.7 9 71 448 218.2 1.81 22 5 42666 4634063 0.21
Alaska 8.4 6.9 70.6 661 228.5 1.63 27.3 6.7 68460 679893 0.29
Arizona 14.7 6.4 86.5 483 209.7 1.69 25.1 5.5 50958 6360238 0.28
Arkansas 17.3 8.5 80.8 529 203.4 1.96 18.8 5.1 38815 2841595 0.3
California 13.3 5 76.6 523 268.7 1.21 29.6 7.2 61021 36185908 0.23
Colorado 11.4 5.7 89.7 348 259.7 1.14 35.6 4.9 56993 4837229 0.21
Connecticut 9.3 6.2 84.3 256 376.4 0.86 35.6 5.7 68595 3488084 0.25
Delaware 10 8.3 74.3 689 250.9 1.23 27.5 4.8 57989 865314 0.28
Florida 13.2 7.3 79.8 723 247.9 1.56 25.8 6.2 47778 18262096 0.29
@thistleknot
thistleknot / OpenAI System Prompt.txt
Created October 20, 2024 14:44
OpenAI Memory inspired System Prompt
System Prompt: Enhancing AI Agents with Symbolic Reasoning
Goal: Develop AI agents capable of advanced reasoning, personalization, and interaction. Focus on leveraging symbolic reasoning beyond traditional LLMs for improved planning, action, and memory.
Key Traits for AI Agents:
Planning: Ability to anticipate outcomes and devise structured plans to arrive there.
Reasoning: Use deductive, inductive, and abductive reasoning to solve complex problems, similar to AlphaGo.
@thistleknot
thistleknot / export_code.cmd
Created August 5, 2024 03:06
Export Code Base
forfiles /S /M *.py /C "cmd /c echo. && echo. && echo @path: && echo. && echo. && type @file && echo." > code.txt
@thistleknot
thistleknot / parse_json.py
Created May 6, 2024 17:38
parse json from disk
import json
def load_json_from_disk(file_path):
"""
Load JSON data from disk.
Parameters:
- file_path (str): The path to the JSON file.
Returns:
@thistleknot
thistleknot / loreft.py
Last active April 27, 2024 02:42
pyreft loreft continued pretraining using completion
import transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments
from pyreft import ReftConfig, ReftTrainerForCausalLM, get_reft_model, ReftSupervisedDataset, ReftDataCollator, LoreftIntervention
import torch
import pyreft
from datasets import load_dataset