Skip to content

Instantly share code, notes, and snippets.

View davidpp's full-sized avatar

David Paquet Pitts davidpp

View GitHub Profile
@davidpp
davidpp / insights_agent.md
Created November 14, 2025 18:15 — forked from Dowwie/insights_agent.md
langsmith insights agent

LangSmith Insights Agent: Complete Reverse Engineering

Executive Summary

LangSmith's Insights Agent is an LLM-orchestrated data analysis system that automatically discovers usage patterns and failure modes in production agent traces. Unlike traditional clustering tools, it accepts natural language questions from users and dynamically adapts its entire analysis pipeline—from feature extraction to taxonomy generation—based on those questions.

Key Innovation: It's a conversational interface to trace analysis, where users describe what they want to learn, and the system translates that into a custom analytical workflow.

Core Capabilities:

  • Analyzes up to 1,000 sampled traces in up to 30 minutes (typically 15-20 minutes)
@davidpp
davidpp / pg_dump
Last active September 24, 2024 14:55
pg_dump for easypanel
#!/bin/bash
# Function to find the container ID of a service's first running task
find_container_id() {
local service_name=$1
docker service ps --filter "desired-state=running" --format "{{.ID}}" $service_name | head -n 1 | xargs -I {} docker inspect --format "{{.NodeID}} {{.Status.ContainerStatus.ContainerID}}" {} | awk '{print $2}'
}
# Function to extract the database name from the service name
extract_db_name() {
@davidpp
davidpp / nx.fish
Created September 19, 2024 14:43
NX autocompletion of run command
function __fish_nx_commands
printf "%s\t%s\n" \
"create-nx-workspace" "Create a new Nx workspace" \
"init" "Initialize an Nx workspace" \
"generate" "Generate code for workspace" \
"run" "Run a target for a project" \
"daemon" "Run the Nx daemon" \
"graph" "Graph dependencies in workspace" \
"run-many" "Run target for multiple projects" \
"affected" "Run target for affected projects" \
BEGIN;
-- Ensure indexes are in place for performance
CREATE INDEX IF NOT EXISTS idx_activity_timestamp ON directus_activity (timestamp);
CREATE INDEX IF NOT EXISTS idx_revisions_activity ON directus_revisions (activity);
CREATE INDEX IF NOT EXISTS idx_revisions_item_collection ON directus_revisions (item, collection);
CREATE INDEX IF NOT EXISTS idx_notifications_timestamp ON directus_notifications (timestamp);
DO $$
DECLARE
@davidpp
davidpp / pgsync.sh
Last active February 28, 2024 21:15
PG Dump and Restore between two easy panel services
#!/bin/bash
# Function to find the container ID of a service's first running task
find_container_id() {
local service_name=$1
docker service ps --filter "desired-state=running" --format "{{.ID}}" $service_name | head -n 1 | xargs -I {} docker inspect --format "{{.NodeID}} {{.Status.ContainerStatus.ContainerID}}" {} | awk '{print $2}'
}
# Function to extract the database name from the service name
extract_db_name() {
@davidpp
davidpp / DirectusLoader.tsx
Created April 13, 2023 14:23
NextJS image loader for Directus
import type { ImageLoaderProps } from 'next/image'
const imgDomain = process.env.NEXT_PUBLIC_IMG_DOMAIN ?? ''
interface DirectusImageProps {
fit?: 'cover' | 'contain' | 'inside' | 'outside'
}
export default function directusImageLoader({
src: imageID,
@davidpp
davidpp / cloud-config.yaml
Last active April 7, 2020 15:50
Lando Dev Cloud-Init
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
manage-resolv-conf: true
resolv_conf:
nameservers:
- '8.8.8.8'
@davidpp
davidpp / setup.sh
Created February 28, 2020 21:31 — forked from bradp/setup.sh
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo "https://github.com/account/ssh \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
#!/bin/bash
########################
### DOCKER & LANDO ###
########################
sudo apt-get update
sudo apt-get install \
apt-transport-https \
function fnDrawPrism(length, numWidth, intHeight){
//If any of these parameters are undefined, throw an error that lists the missing parameters.
// you can cut-and-past the declaration line to fill out 90% of the validation call:
validate(fnDrawPrism, length, numWidth, intHeight);
return length * numWidth * intHeight;
}
// this is cut-and-pasted into a file somewhere, edit to add more types or stricter checking
function validate(args){