Now we are going to talk about how language models handle text. It’s pretty wild when you think about it. Those models break down everything into bits and pieces, and if we’re not careful, they might end up making a bigger mess than a toddler with a paint set!
When we send text to a language model, it’s like throwing a bunch of puzzle pieces into the air. These models look at everything—words, punctuation marks, even that random code snippet you tossed in for good measure. If we’re a bit lax with our formatting, the model can get confused and turn our beautifully crafted commands into a jigsaw puzzle that doesn’t quite fit. For example, say we have something like:
Use auth_token=hmb123 to access the API.
If we forget to wrap our code in backticks, what happens? Well, things can go awry. The model might tokenize auth_token=hmb123 into pieces, breaking it down like this:
["auth", "_", "token", "=", "hmb", "123"]
Yikes! Now, instead of a succinct call to action, we’re left with a jumbled mess. It’s like asking someone to hand you a coffee but saying, "Hey, can you give me water, dark brown liquid, caffeine, please?"—it's just not clear! But, if we play it safe and wrap the command in backticks like so:
`auth_token=abc123`
Then the model sees it as a unified command. It doesn’t try to slice and dice it into random bits; it just gets it in one go. This little trick ensures that our text stays intact, making sure the model knows exactly what to do.
All in all, it’s essential to keep formatting in mind. Here’s a handy checklist for keeping things smooth:
Staying on top of these details helps us to avoid stressing over how our text is perceived. With some basic attention, we can make communication with LLMs a breeze instead of wrestling with them like a slippery fish out of water. Let’s keep the text flowing and clear!
Now we are going to talk about the importance of organizing information in a way that keeps things clear and concise, especially when it comes to documentation.
Imagine you’re throwing a party, and the last thing you want is for your guests to mingle with the lawn gnomes instead of each other. Well, the same concept applies to how we present information. When an AI assistant responds to questions about permissions, it can inadvertently spill out rate-limit details just because they were stuck in the same document section. Talk about TMI (too much information)!
Think about it. If you lay out your topics like a well-organized buffet, everyone knows where to go for their favorite dish. Here’s a real-life example from our own documentation journey:
## Permissions and Rates
To update permissions, call /permissions/update. API calls are limited to 50 per minute; exceeding this returns a 429 error.
Putting “Permissions” and “Rates” together in one section is like mixing tacos and ice cream at a gathering. They just don’t belong together! So, when someone asks, "How do I update permissions?", the model throws back a mishmash of both sections, making everyone confused. We’ve all been there—scratching our heads, wondering if we need a manual to figure things out.
If we peel these topics apart and create clear sections, we get:
## Permissions
To update permissions, call /permissions/update.
## Rate Limits
API calls are limited to 50 per minute; exceeding this returns a 429 error.
Now, if the AI fielded the question about updating permissions, it would simply pull out the relevant chunk without getting tangled in unrelated rate-limit rules. We could almost hear the collective sigh of relief from confused users!
In short, let’s consider the benefits of chunking our content wisely:
So, let’s agree: clarity is king! By organizing information in a straightforward manner, we not only help AI presentations but also keep our human readers happy and informed. That’s a win-win in our book!
Now we are going to talk about effective ways to optimize document structure for retrieval and comprehension. You know, just like trying to find that missing sock in a laundry basket full of mismatched pairs—it can get messy, right? So, let’s break things down.
In retrieval setups, documents are transformed into numeric vectors that represent their essence. When someone throws a question into the mix, the AI converts it into a similar vector and goes on a treasure hunt for matching pieces among the document vectors. But here’s the kicker—if two sections are too similar, the AI might grab the wrong chunk like trying to pull out a pair of jeans when you meant to grab your favorite sweater.
Consider this amusing scenario: Imagine we have seen these headings before:
## Session Management
Sessions expire after 30 minutes of inactivity.
## Session Costs
Each session incurs a cost of $0.01 per minute.
If you ask, “What’s the cost per session?” you might oddly end up in the “Session Management” section. Why? Well, it turns out both sections are high-fiving over the word “Session.” But, if we cleverly rebrand the first heading to “Session Timeout,” we get:
## Automatic logout timing
Users are automatically logged out after 30 minutes of inactivity.
## Billing rates
Each session incurs a cost of $0.01 per minute.
Those new headings create unique vectors, avoiding an overlap that leaves us confused at the AI’s clumsy decision-making party.
However, while we’re busy tweaking our headings, there are common pitfalls lurking around that can trip us up—like banana peels on a slick floor. Here’s a list of mistakes that often hinder AI:
Understanding how AI interprets our writing is just scratching the surface.
To ramp up the AI-friendliness of our documents, we should write in ways that boost accuracy, clarity, and context. Clear sections not only help AI but can also keep our computational costs down. Think of it like cleaning up your workspace; less clutter means less stress and more efficiency.
Let’s explore some essential principles for structuring your documents effectively—like the golden rules of food seasoning. Below are five standout principles to keep in mind:
Principle | Before Example | After Example |
---|---|---|
Clear Headings | Section 1 | Introduction to User Sessions |
Consistent Formatting | Here is some inline code with no distinction. | Here’s a clear code block: function example() {} |
Avoid Overlaps | Costs and Timings | Session Costs Explained |
Now we are going to discuss an essential aspect of formatting that can help ensure clarity in our documents.
We've all been there, right? One minute you're reading a well-organized document, and the next, you're tangled in a web of confusing headings that feel like a bad plot twist in a thriller movie. That’s why establishing a clear structure in headings matters. When headings leapfrog levels like they're in a high-stakes game of hopscotch, AI can throw up its virtual hands in confusion. It’s like asking a toddler to explain quantum physics—everyone’s lost.
Before
# Settings
### Notifications
Configure how alerts are sent.
## General Settings
Set the default language and timezone.
In the snippet above, Notifications jump to H3, while General Settings flops back to H2. An AI might treat Notifications as an entirely unrelated topic, akin to suggesting pizza toppings when everyone is discussing the weather.
Now, let’s straighten this out.
After
By making both General Settings and Notifications H2 under Settings, we allow AI—and even humans—to recognize the connection. Think of it like pairing your favorite medium roast coffee with a delectable croissant. They just belong together.
# Settings
## General Settings
Set the default language and timezone.
## Notifications
Configure how alerts are sent.
Here’s a little checklist to keep us on the right track:
So, next time we structure documents, let’s remember: a clear heading hierarchy is our best friend. It keeps everything in line and our readers’ brains from doing somersaults. After all, clarity is key! Who wants to untangle textual spaghetti? Not us.
Now we are going to talk about clarity in communication, especially when dealing with techy stuff that has its own language. Misunderstandings can lead to snafus that just aren’t fun—trust us. Think about the last time you followed a recipe and didn’t quite understand whether “it” meant the dough or the oven. Spoiler alert: burnt cookies! So, let’s unravel this mystery together.
Pronouns can sometimes send AI scrambling like a cat in a room full of rocking chairs. They often can’t guess which item we’re referencing. So, let’s lay down some ground rules by naming the stars of our show.
Before
Open the config file and update the IP address. Then save it and restart the server to apply it.
In the snippet above, our AI pal could feel like it’s playing a game of charades. “Is ‘it’ the file, the address, or maybe even the server having an identity crisis?” Who knows?
After
Open the `config.yaml` file and update the `server_ip` setting. Then save the `config.yaml` file and restart the server to apply the new IP address.
By repeating “config.yaml file” and “server,” we eliminate any shadow of doubt. Clarity is key, folks! Kind of like a GPS providing step-by-step directions instead of saying, “Go that way.”
When we clarify our references, we help both people and AI do their jobs better—because nobody likes giving directions when nobody's listening. And let’s face it, no one wants to spend hours fixing a problem that stems from a simple misunderstanding.
Here are a few pointers we can keep in our back pocket:
So, the next time you’re drafting that important email, a code snippet, or even drawing up dinner plans, let’s keep those pesky vague pronouns on a tight leash. After all, no one wants to end up fighting over whether “it” meant the pasta or the sauce! And let’s not forget, clear communication saves time and sanity—a win-win for everyone involved.
Now we are going to talk about providing alternatives to multimedia content, which is quite a big deal in making our online presence more accessible.
So, here's the scoop: AI has a tough time with images and videos. Just think about that friend who can’t recognize photos from last year’s vacation unless you give them a caption. We're going to ensure our media doesn’t leave anyone in the dark.
Before

Click the image for a detailed view.
Now, let’s be real. This method is lovely and all, but AI is like that one uninterested student in the back of the class who just doesn’t engage. It sees the code and said, “No thanks!”
After

Alt text: Diagram indicating a web server sending requests to two application servers with a load balancer.
> Note: If you can't see the image, here’s a quick summary:
> A load balancer is sharing the incoming web requests between App Server A and App Server B, both connected to a single database.
By adding alt text and a summary, we’re basically handing AI the cheat sheet it never asked for but desperately needs!
Let’s wrap our heads around why this matters
So, with a pinch of creativity and a dash of humor, let's ensure our media isn't just pretty to look at but also packed with useful info. We can make our content shine brighter than a freshly polished trophy!
Next, we’re going to explore the importance of using consistent terminology—essentially, sticking to one name for each concept we communicate about. This is especially important when dealing with AI systems, which can get a bit befuddled if we don’t play nice. Just think about that time you tried to explain a movie plot to a friend, and 20 minutes later, they were still convinced you were talking about two different films!
Confusion is the enemy of clarity—especially when it comes to tech lingo. If we toss around multiple terms for the same concept, it’s like mixing up the salt and sugar while cooking. Spoiler alert: nobody wants a salty dessert!
Before
To run the app, edit the config file. Next, use the configuration document to set environment variables. Finally, launch the application.
This snippet shows how using “config file” and “configuration document” might leave AI scratching its metaphorical head, wondering if they’re even the same thing.
After
To run the app, edit the `config.yaml` file. Next, use the `config.yaml` file to set environment variables. Finally, launch the application.
By keeping it simple and consistent, referring to it solely as the ‘config.yaml file’, we eliminate the risk of any mix-up that could have our digital assistants playing detective.
Version | Example |
---|---|
Before | To run the app, edit the config file. Next, use the configuration document to set environment variables. |
After | To run the app, edit the `config.yaml` file. Next, use the `config.yaml` file to set environment variables. |
So, every time we’re drafting something technical, let’s channel our inner poet for consistency. Everyone appreciates a little clarity sprinkled with a touch of humor. Remember, a clear message is always as good as a well-cooked meal—nobody wants any surprise ingredients in their tech talk! To quote a famous chef, “If you can’t stand the heat, get out of the kitchen.” But we’re not going anywhere—let’s keep that communication crisp and clear!
Now we are going to talk about why using backticks for code samples is essential in our technical documentation. We all know how much of a nuisance it can be when code snippets get all jumbled up, turning a simple instruction into a tech riddle.
Inline code can easily become the Shakespeare of tech writing—overly flowery and utterly confusing. Fenced code blocks help keep each command as a distinct unit, preventing them from losing their charm.
Before:
Install the tool with pip install pdf2doc==1.2.3 and check the version with pdf2doc --version.
But oh boy, AI might slice pip install pdf2doc==1.2.3 like a butter knife through warm butter, making it hard for anyone (or anything) to understand.
After:
Let’s give it a facelift:
To install the tool, use the command:
```bash
pip install pdf2doc==1.2.3
```
To check the version:
```bash
pdf2doc --version
```
Now each command stands tall in its own fenced code block, making it unmistakably clear it’s a code snippet!
Having these principles locked and loaded, let’s roll up our sleeves and see how structure impacts our documentation style. Consider this: authenticating with an API. We can compare a not-so-great version with a properly structured one.
API Auth
Endpoint:
To authenticate, send a POST request to /auth along with your credentials.
Usage:
Issue this curl command:
curl -X POST /auth -d '{"user":"alice","pass":"secret"}'
You'll get a token in return. Use the token in the header for further requests.
Errors:
Sending incorrect credentials gives you an HTTP 401. You can also utilize /login or /userinfo, but they don't work the same way.
What clutters up this example?
Here’s the upgraded edition with a sprinkle of clarity, where we have neat headings, logical naming, and adorned code blocks:
## Authentication
### Endpoint: `POST /auth`
This endpoint retrieves an access token.
#### Request
```bash
curl -X POST https://api.example.com/auth \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"secret"}'
Response:
{
"access_token": "a2e-098-rkjlponms",
"expires_in": 3600
}
Error response:
{
"error": "invalid_credentials",
"message": "Username or password is incorrect"
}
Using the access token:
When you get that shiny access_token, include it in the Authorization header for your next API calls.
Example: GET /userinfo
curl -X GET https://api.example.com/userinfo \
-H "Authorization: Bearer a2e-098-rkjlponms"
Response:
{
"id": "user_001",
"username": "ftimah",
"email": "[email protected]"
}
This revamped example uses markdown headers, separates commands into neatly fenced code blocks, and avoids ambiguous pronouns, making everything far more readable.
So, why does the polished version shine brighter?
If you've ever typed out a long command only to find it was completely misread by an AI, you know the pain of poorly formatted examples. Let’s spark up some practical tests to check our documentation game.
The best way to ensure your writing appeals to both humans and AIs is to run a few prompts through some AI tools. Pick one—whether it's ChatGPT, Claude, or your fave—and feed it your prompts. If the AI goes off-track or misses the core of your instructions, you know your structure could use some TLC.
Here’s a simple starter plan for you:
For example:
Example in action:
Prompt: How do I install the CLI?
If you’ve got all these practices under your belt, your documentation will be the talk of the town. Ask yourself, is it AI-friendly? With a bit of tweaking, we can make our docs sing—a sweet melody that not just AIs, but humans will hum along to!
Want to future-proof your documentation while keeping it pristine? It might be worth taking a peek at Mintlify today!