Skip to content

Instantly share code, notes, and snippets.

View p3nj's full-sized avatar
🙏
Don't think, feeeeeeeeeeeeel

p3nj p3nj

🙏
Don't think, feeeeeeeeeeeeel
View GitHub Profile

AI Agent Memory Architecture

The Problem

Most AI assistants suffer from context amnesia — they forget everything between sessions. Even with context windows expanding to 200K+ tokens, you eventually hit limits, and long conversations become unwieldy.

The core issues:

  1. Session isolation — Each new chat starts blank
  2. Context bloat — Long histories slow down inference

Monchi Memory Architecture

The Problem

Most AI assistants suffer from context amnesia — they forget everything between sessions. Even with context windows expanding to 200K+ tokens, you eventually hit limits, and long conversations become unwieldy.

The core issues:

  1. Session isolation — Each new chat starts blank
  2. Context bloat — Long histories slow down inference

Monchi Memory Architecture

The Problem

Most AI assistants suffer from context amnesia — they forget everything between sessions. Even with context windows expanding to 200K+ tokens, you eventually hit limits, and long conversations become unwieldy.

The core issues:

  1. Session isolation — Each new chat starts blank
  2. Context bloat — Long histories slow down inference
# Monchi Memory Architecture
## The Problem
Most AI assistants suffer from **context amnesia** — they forget everything between sessions. Even with context windows expanding to 200K+ tokens, you eventually hit limits, and long conversations become unwieldy.
The core issues:
1. **Session isolation** — Each new chat starts blank
2. **Context bloat** — Long histories slow down inference
@p3nj
p3nj / fix-amxmodx-metamod-execstack.md
Created December 22, 2025 06:06
Fix AMXModX & Metamod failing to load on modern Linux. Clear executable stack flags with execstack -c.

Fix AMXModX & Metamod Loading on Modern Linux

Problem

When trying to load AMXModX and Metamod (e.g., from KZRU LAN server packages) on modern Linux distributions, the game crashes or fails to load the plugins with errors like:

dlopen failed: cannot enable executable stack
@p3nj
p3nj / fix-sdl-mousewheel-bug.md
Created December 22, 2025 06:05
Fix for CS 1.6 / Half-Life (Steam Legacy) mouse wheel triggering MOUSE4/MOUSE5 on Linux. Replace bundled SDL2 with system library.

Fix CS 1.6 / Half-Life Mouse Wheel Bug on Linux [steam_legacy]

Problem

On modern Linux distributions (Fedora, Arch, Ubuntu 22.04+, etc.), Counter-Strike 1.6 and other GoldSrc games have a mouse wheel bug where:

  • MWHEELDOWN triggers both scroll down AND MOUSE5
  • MWHEELUP triggers both scroll up AND MOUSE4

This causes issues like:

@p3nj
p3nj / useless-api.js
Last active March 23, 2025 22:29
An useless API
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
// Middleware to parse JSON and form data
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Default timeout duration in milliseconds
const DEFAULT_TIMEOUT = 5000; // 5 seconds
@p3nj
p3nj / ecc.py
Last active May 15, 2024 14:15
A Python script generate the Elliptic-curve chart.
import numpy as np
import matplotlib.pyplot as plt
def modular_sqrt(a, p):
"""
Compute the modular square root of a modulo p using the Tonelli-Shanks algorithm.
Returns the two square roots if they exist, or None if no square root exists.
"""
a = int(a) # Convert a to a regular integer
if pow(a, (p-1)//2, p) != 1:
@p3nj
p3nj / question2.py
Created April 21, 2024 23:06
LFSR python script for Assignment 2 of Applied Cryptography in QUT
def xor(a, b):
"""
Helper function to perform XOR operation on binary strings
Source: https://www.tutorialspoint.com/tuple-xor-operation-in-python
"""
return ''.join(str(int(x) ^ int(y)) for x, y in zip(a, b))
def berlekamp_massey(keystream):
@p3nj
p3nj / fs.c
Last active September 8, 2023 20:23
Python script to generate a GDB-like stack table using the format string vulnerability.
#include <stdio.h>
char passwd[80];
void main()
{
printf("Please enter password: ");
if (login() == 'T')
welcome();
else