Skip to content

Instantly share code, notes, and snippets.

View seaberger's full-sized avatar

Sean Bergman seaberger

View GitHub Profile
@seaberger
seaberger / ACCOMPLISHMENTS_SUMMARY.md
Created July 14, 2025 00:14
DSPy Prompt Optimization Framework - Technical Accomplishments & Results

🎯 DSPy Prompt Optimization Framework - Class Accomplishments

🌟 Project Overview

Successfully implemented a complete DSPy-based prompt optimization framework integrated with a production Gemini API + RAG system for technical document Q&A.

🚀 Major Accomplishments

1. Complete DSPy Integration

  • Custom Gemini LM Wrapper: Built DSPy-compatible interface for Gemini API
  • RAG Module Integration: Connected DSPy optimization to existing retrieval system
@seaberger
seaberger / CLASS_SHARING_PACKAGE.md
Created July 14, 2025 00:14
Complete DSPy Project - Class Sharing Package & Accomplishments

🎓 DSPy Prompt Optimization - Class Sharing Package

🌟 Quick Summary

Successfully implemented a complete DSPy-based prompt optimization framework that dramatically improved a production Gemini API + RAG system for technical document Q&A.

🚀 Key Accomplishments

  • 3x Better Technical Response Quality
  • Automated Prompt Engineering (no more manual crafting!)
  • Production-Ready Integration with real Gradio app
  • Research-Grade Framework with quantitative evaluation
@seaberger
seaberger / gradio_integration_example.py
Created July 14, 2025 00:14
DSPy + Gradio Production Integration Demo
#!/usr/bin/env python3
"""
DSPy + Gradio Integration Example
Shows how to integrate DSPy optimizations into a production Gradio app
"""
import gradio as gr
import dspy
import google.generativeai as genai
import os
@seaberger
seaberger / dspy_key_concepts.md
Created July 14, 2025 00:14
DSPy Key Concepts & Implementation Guide for Students

🤖 DSPy Key Concepts & Implementation Guide

What is DSPy?

DSPy is a framework for automatically optimizing prompts and few-shot examples for language models. Instead of manually crafting prompts, DSPy uses algorithms to systematically find the best prompts for your specific task.

🔑 Core DSPy Concepts

1. Signatures - What your model should do

@seaberger
seaberger / dspy_demo_simple.py
Created July 14, 2025 00:14
DSPy Prompt Optimization - Simple Before/After Demo
#!/usr/bin/env python3
"""
DSPy Prompt Optimization Demo - Simple Example
Shows before/after comparison of optimized prompts
"""
import os
import dspy
import google.generativeai as genai
from dotenv import load_dotenv
@seaberger
seaberger / 4-app-gemini-api-direct-cached.py
Created July 10, 2025 05:43
PDF Q&A using direct Gemini API upload
import os
import gradio as gr
import sqlite3
import google.generativeai as genai
from datetime import datetime
import uuid
# Load API key from .env file
from dotenv import load_dotenv
@seaberger
seaberger / 4-app-gemini-api-direct.py
Created July 10, 2025 05:34
PDF Q&A using direct Gemini API upload
import os
import gradio as gr
import sqlite3
import google.generativeai as genai
from datetime import datetime
import uuid
# Load API key from .env file
from dotenv import load_dotenv
@seaberger
seaberger / 4-app-gemini-api.py
Created July 10, 2025 04:52
PDF Q&A app using Gemini API
import os
import gradio as gr
import fitz # PyMuPDF
import sqlite3
import google.generativeai as genai
from datetime import datetime
import uuid
import re
# Load API key from .env file
@seaberger
seaberger / PROJECT_SUMMARY.md
Created April 3, 2025 04:27
Project Summary: Technical Support Chatbot for Laser Measurement Products

Project Summary: Technical Support Chatbot for Laser Measurement Products

Goal

To create an intelligent chatbot that can accurately answer technical questions about laser power meters, energy meters, and beam diagnostics products by leveraging information directly from product datasheets.

Core Technology

Retrieval-Augmented Generation (RAG) using LlamaIndex, LlamaParse, OpenAI, Cohere, Qdrant, SQLite, and FastHTML.

Workflow Overview