Hey HN,<p>We built Directed Intelligence to tackle the problems we faced with ChatGPT-style applications. It's not a library (yet), but a pattern for building better apps.<p>Here’s our story:<p>Why We Built It:<p>We started by building a "wrapper" very similar to ChatGPT but it sucked.<p>- Users found responses inconsistent and unreliable.<p>- Conversations drifted off-topic.<p>- Advice was generic.<p>- Experts struggled to steer the model via prompts without technical skills.<p>Our Solution:<p>- Combine LLMs with focused scripts written in natural language.<p>- Active topic management to keep conversations on track.<p>- The system selects and follows the right scripts based on user input.<p>How It Works:<p>- Starts with a base LLM like GPT-4.<p>- Selects and follows appropriate scripts.<p>- Monitors context and switches scripts as needed.<p>- Adds external tools only when scripts call for them.<p>Real-World Example (<a href="https://fforward.ai" rel="nofollow">https://fforward.ai</a>):<p>- We built a CMS to manage all our scripts<p>- We use a state machine and various LLMs to select the appropriate script, monitor context, and swap scripts when needed.<p>Check out our demo to see it in action: fforward.ai. No signup required.<p>Looking forward to your feedback!<p>Cameron Westland, Max Cameron, Jon Friis