hsk@infra
/
$ cd ~/projects/stumberg

Stumberg

Personal AI agent — LangGraph, four modes, persistent threads

discontinued hand 2025-12-03

Stumberg is my crown jewel. It is my largest personal project so far, and the first in this series. The original idea was to replicate the functionality of ChatGPT but tailored to my needs. I hated repeating myself all the time and trying to curb its agreeable responses, so I set out on this journey.

The final product was a working agent with multiple modes, persistent conversations, file context, and a search subagent, all tailored to me. Although I will admit that I have discontinued use and maintenance of the project, as the scope just grew larger and larger — upkeep of APIs, bugfixing and so on all take lots of time, time which I wanted to spend learning other new things.

Also the usage was not that practical: booting up a Docker container and running on localhost is not ideal. If I were to revisit this project I would definitely prioritise having CI/CD and a proper deployment pipeline.

The idea of Stumberg was somewhat revived in my project Goswin.

Features

FeatureDescription
Multi-Mode OperationFour distinct modes with tailored system prompts, model selection, and tool access
Persistent ConversationsPostgreSQL-backed state with thread-based history and automatic checkpointing
File ContextPer-conversation uploads (txt, md, py, json, pdf) injected into system prompts
Search SubagentDedicated subagent with web, Reddit, subreddit, and r/BuyItForLife search
Vector Search (RAG)Pinecone-powered semantic retrieval for knowledge base querying
WeatherReal-time, location-based weather via Open-Meteo

Modes

ModeModelPurpose
PersonalGPT-4oShopping & lifestyle — Reddit + r/BuyItForLife integration
WorkGPT-4oFactual research & study — no assumptions
CodeGPT-4oCode creation, debugging & optimisation — full output, no fluff
FastGPT-4.1-nanoUltra-fast, minimal responses

Architecture

A LangGraph state machine with the following flow:

Streamlit UI
    │
    ▼
Agent Graph ──────────────► PostgreSQL (checkpointer)
    │
    ▼
Tool routing
    ├── Weather tool
    ├── Vector search
    └── Search subagent
            ├── Web search
            ├── Reddit search
            ├── Subreddit search
            └── BuyForLife search

Tools

ToolSourceDescription
get_weatherOpen-Meteo APIReal-time weather data
retrieve_contextPineconeVector search for RAG
ask_search_agentSearch subagentDelegates to the specialised search tools below
↳ general_searchLinkupClientWeb search
↳ reddit_searchPRAWReddit-wide search
↳ subreddit_searchPRAWTargeted subreddit search
↳ buyforlife_searchPRAWr/BuyItForLife scraping

Tech Stack

LayerTechnology
OrchestrationLangGraph
LLM FrameworkLangChain
UIStreamlit
DatabasePostgreSQL (langgraph.checkpoint.postgres)
ModelsGPT-4o, GPT-4.1-nano (OpenAI)
Vector DBPinecone
Web SearchLinkupClient
RedditPRAW
WeatherOpen-Meteo API
TracingLangSmith (optional)

Project Structure

Stumberg/
├── app.py                  # Streamlit interface
├── main.py                 # CLI entry point
├── graph.py                # LangGraph agent graph
├── models.py               # Model configurations
├── prompts.py              # Mode-specific system prompts
├── schema.py               # AgentState definition
├── tools/
│   ├── search.py           # Search tool implementations
│   ├── weather.py          # Weather tool
│   └── vector_search.py    # Pinecone integration
├── subagents/
│   └── search_subagent.py  # Search delegation subgraph
├── middleware/
│   └── call_wrapping.py    # Call wrapping utilities
├── RAG_building_scripts/   # Vector store build utilities
├── Dockerfile
├── requirements.txt
├── langgraph.json          # LangGraph deployment config
└── ROADMAP.md

Getting Started

Prerequisites

  • Python 3.10+
  • PostgreSQL
  • OpenAI API key

Install

pip install -r requirements.txt

Configure

Create a .env file:

# Required
OPENAI_API_KEY=your_key
DB_URI=postgresql://user:password@host:port/database

# Optional
PINECONE_API_KEY=your_key
LINKUP_API_KEY=your_key
LANGCHAIN_API_KEY=your_key
LANGCHAIN_PROJECT=your_project
CONVERSATION_DATA_PATH=/path/to/conversation/data

Run

# Streamlit UI
streamlit run app.py

# CLI
python main.py

Docker

docker build -t stumberg-agent .
docker run -p 8501:8501 \
  -v /path/to/data:/host_e/conversation_data \
  --env-file .env \
  stumberg-agent

License

Personal use and experimentation.

$