> For the complete documentation index, see [llms.txt](https://breakpoint-journal.gitbook.io/breakpoint/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://breakpoint-journal.gitbook.io/breakpoint/ai/grokking-the-ai-system-design.md).

# Grokking the AI System Design

## Designing Agents

General-purpose agents may work in dev but fall apart in production environments. It's important to define constraints and make each agent's purpose and role as explicit as possible. The critical bits are the stopping conditions, feedback loops, and incentives. You're not necessarily scripting ehavior step by step (although you certainly can), you're defining the high level goals that, over the course of the feedback loops, allow the agent to come closer toward.

Self-reflectiveness is essential for this feedback loop. Claude agents use explicit self-reflection phases where the agent reviews its reasoning before taking action.

Uncertainty - how does an agent handle uncertainty? It may retry with variations, ask questions, or just stop and error.&#x20;

Tooling - under what explicit conditions should agent make a websearch, query an API, etc? These must be clearly defined. Commonly, there is an orchestration layer that validates the intent, enforces constraints, and observes the outcomes. This layer is important for logging, a relevant feature for debugging and compliance

| AI FRAMEWORKS   | DESCRIPTION                                                           |
| --------------- | --------------------------------------------------------------------- |
| LangChain       | provides abstracted tool definitions, chaining, and memory management |
| AutoGen         | provides multi-agent conversations, orchestration                     |
| Semantic Kernel | lightweight SDK for coordinating AI behavior                          |
| MetaGPT         | offers specialized agent roles for software workflows                 |

Sandboxing - agents shouldn't directly access raw APIs; rather, instead Claude and GPT utilize strict sandboxes to log and mediate outbound requests.

Short Term vs Long Term Memory
