System Prompts Tips, Tool Design, XML, avoiding frameworks abstraction, and more.
Published: 2026-01-12
URL: https://thepipeandtheline.substack.com/p/learnings-from-1-year-of-building
Hi there! Alejandro here 😊 Subscribe if you like to read about technical data & AI learnings, deep dives! Enjoy the reading and let me know in the comments what you think about it 👨🏻💻 📝 TL;DR Less system prompt = more consistency on LLM output. Don’t force rigid templates because AI will hallucinate to match the template and not give an useful output. Tool design is critical, each description its a prompt itself and the tools should not overlap. Build the agent loop before using frameworks and read source code when debugging to understand what’s happening.
XML tags beat JSON for agents, they are quite useful for debugging and structured agent thinking. ⚠️ Disclaimer: these are not learning from building demos, they are actual experience on production. I spent the last year building demos and POCs that became AI agents. I also built MCP servers, read “RAG is dead” 502 times and had no idea what my agents where responding every single time. My greatest learnings are only possible if you are hands on about it, which implies staying about from Linkedin gossip and closer to actually implementing them.
Let’s get started. Image generated by ChatGPT. 🎯 Less System Prompt, More Sanity I kept seeing people write massive system prompts that looked like legal contracts. Instructions overlapping, rules contradicting each other, edge cases piled on edge cases. You can’t beat non-deterministic answers from LLMs, that’s a fact.
But you can close that gap and control the output a lot with the right instructions. Anthropic’s research on context engineering calls it “context pollution/rot.” The challenge is curating what information enters the model’s attention budget. My best example: had a prompt that was 1000 lines. Did a super risky PR to reduce it to 250 lines, cleaning up a lot of confusion. Users starting saying “now is more intelligent and it gets what you want” Pro tip: attach Anthropic documents on context engineering to your favorite LLM to make a research and optimise your prompt based on best practices. 🎭 Stop Over Structuring with Rigid Templates Made this mistake a lot: “Give me 3 recommendations.” “List 5 reasons.” “Generate exactly 4 paragraphs.” If the model only has enough information for 2 recommendations, forcing it to give 3 means it will hallucinate the third.
Confidently wrong is the worst kind of wrong. The fix? Give the model freedom to decide: Instead of “Give me 3 recommendations” try “Give me your top recommendations (typically 2 to 4)” Instead of “Write exactly 4 paragraphs” try “Write a comprehensive explanation” Words are powerful, and as new models are released, this is more and more evident. Let the model use its intelligence instead of forcing it into boxes.
The Pipe & The Line is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber. 🛠️ Tool Design Is Everything Without tools your agent is just another ChatGPT wrapper. I spent months iterating on tool design for my Substack Author MCP, and here’s what I learned.
Each tool should do ONE thing. Not two things. Not “fetch data OR process it.” One thing. If you need “and” or “or” to describe what your tool does, it’s doing too much. Split it. This is fundamental code design and its based on functional programming principles. Tool names and descriptions matter more than you think.
The LLM decides which tool to call based on the name and description: ❌ Bad tool name: getdata ✅ Good tool name: fetcharticle_content ❌ Bad description: “Gets stuff from the API” ✅ Good description: “Fetches the full text content and metadata for a specific Substack article given its URL” From the MCP best practices guide: “Each tool should have a unique name that explains its function clearly and a description that highlights what the tool does, what its purpose is, and the specific action(s) it takes.” No overlapping tools.
If you have getuser, fetchuser, and retrieve_user, you’re confusing the model. Pick one. Delete the others. Tools descriptions are prompts, the same rules of “less system prompt” principle applies here.
The best reality check? Ask the same question 10 times and see if the agent always picks the same tool. If it doesn’t, your tools overlap too much. Thanks for reading The Pipe & The Line! This post is public so feel free to share it. Share 🔧 Skip the Framework, Build the Loop First Here’s something nobody wants to hear: you should probably build your first agent without a framework. LangChain, LlamaIndex, CrewAI, n8n are all excellent tools.
But if you don’t understand what’s happening under the hood, you’re going to have a terrible time debugging when things break. At least, read the source code behind the framework you are using to really get what’s going on behind the abstraction. Follow Paul in order to get this mindset completely inserted in your mental model: Decoding AI Magazine Tool Calling From Scratch to Production: The Complete Guide Welcome to the AI Agents Foundations series—a 9-part journey from Python developer to AI Engineer.
Made by busy people. For busy people… Read more 7 months ago · 46 likes · 5 comments · Paul Iusztin You will start seeing snippets like this one: That’s it. That’s the whole agent pattern: A loop that accumulates messages in a list Parses tool calls from the response and executes them Keeps going until done Once you understand this, framework abstractions make sense. You will be able to read source code and know exactly where to look when debugging. 🏷️ XML Tags Are Your Secret Weapon Many LLM models allow you to work with structured outputs, but when you want to structure thinking process half way there, you need something else.
Anthropic did this on Claude’s system prompt and when you include them, instructions following become more precise. It looks like this: From Anthropic’s documentation: “Claude has been fine tuned to pay special attention to XML tags.” If you’re building agents that need to reflect before acting, stop fighting with JSON. What’s fantastic about this approach is that you can use it to parse the LLM response afterwards to extract whatever the LLM has given and use that “hidden” output to enrich the UI to which the agent is exposed, and that’s so powerful!
For example, I did it with Chainlit Actions to provide follow up one click suggestions based on the agent system prompt and last message, but that XML pattern was never rendered in the UI, just the raw output. If you enjoyed the content, hit the like ❤️ button, share, comment, repost, and all those nice things people do when like stuff these days. Glad to know you made it to this part! Hi, I am Alejandro Aboy. I am currently working as a Data Engineer. I started in digital marketing at 19. I gained experience in website tracking, advertising, and analytics.
I also founded my agency. In 2021, I found my passion for data engineering. So, I shifted my career focus, despite lacking a CS degree. I’m now pursuing this path, leveraging my diverse experience and willingness to learn. Follow me on Linkedin