LangGraph: Adding Plan-and-Execute Planner

Adding Plan-and-Execute Planner All sources can be found in our github history. When using LLMs for complex tasks like hacking, a common problem is that they become hyper-focused upon a single attack vector and ignore all others. They go down a “depth-first” rabbit hole and never leave it. This was experienced by me and others. Plan-and-Execute Pattern One potential solution is the ‘plan-and-solve’-pattern (often also named ‘plan-and-execute’-pattern). in this strategy, one LLM (the planner) is given the task of creating a high-level task plan based upon the user-given objective. The task plan is processed by another LLM module (the agent or executor). Basically, the next step from the task plan is taken and forwarded to the executer to solve within in a limited number of steps or time. ...

October 14, 2024 · 8 min · 1607 words · Andreas Happe

LangGraph: Simplify our Tool-Calling Agent through `create_react_agent`

Simplify our Tool-Calling Agent through create_react_agent LangGraph has some amazing Prebuilt Components, one of them is the create_react_agent function that allows you to hughely simplify creating new tool-using agents. The full source code can be found within our github history. The simplified version This willb e based upon our recent configuration-improved version. Similar to that version, we start by reading the configuration data, setting up our LLM, connecting to the target system via SSH, and configuring tools for usage through LLMs: ...

October 12, 2024 · 2 min · 309 words · Andreas Happe

LangGraph: Improving Configuration Handling, esp. for Tools

Improving Configuration Handling, esp. for Tools While being quite happy that the initial prototype worked within hours, its code was very prototype-y, i.e., much of its configuration was hard-coded. In a second step, we want to fix this by making our target information (the SSH connection) configurable and remove all hard-coded credentials from the code. Big Picture We are already using python-dotenv for some of our configuration so it makes sense to further utilize this for more configuration data. In the improved implementation, our .env will look like this: ...

October 11, 2024 · 5 min · 920 words · Andreas Happe

Network Concurrency Problem

A project I’m involved with has a traditional distributed client-server architecture: multiple servers are interconnected, clients connect to one more servers. In this use-case we’re expecting around four to seven servers with long-running connections between them and approx. a dozen clients with short-lived connections to the server. Initially I had used plain Java networking but during 2013 I’ve switched over to netty.io as a communication layer. Benefits were more agile networking code, better concurrency, etc. At least in theory. ...

November 13, 2015 · 3 min · 514 words · Andreas Happe

Generating PDFs with wicked_pdf

Ruby on Rails is perfect for creating web applications but sometimes you just need to create some documents which can be stored or send through email. While printing is no problem with CSS not all users are able to “save/print page as pdf”. The ubiquitous Adobe PDF file format seems to be a perfect solution for this problem. The common solution for this is Prawn (also see the RailsCast about it). Alas prawn uses a custom DSL for defining and styling the document and I would rather prefer to reuse existing view partials. princeXML seems to solve this: it transforms existing HTML/CSS into pdf. This allows to reuse existing views and partials but comes with a hefty price-tag of $3500+. ...

May 1, 2012 · 4 min · 670 words · Andreas Happe