Prompt, context, harness & loop engineering, clearly explained!
An agent is a while loop with four layers of engineering wrapped around it:
- Prompt engineering
- Context engineering
- Harness engineering
- Loop engineering
Each one wraps the last, and the model sits in the middle, so none of them compete with the others. Instead, they just zoom one level further out.
> Prompt engineering:
This defines the input the model sees on one call, often composed of a role, instructions, examples, and an output format.
The techniques here alter the internal computation and reasoning the model goes through due to the wording it sees:
- Chain-of-thought makes it work in steps before answering
- Few-shot examples define the format and the edge cases
- A JSON schema or XML tags make the output parseable by code
- Self-consistency samples a few chains and takes the majority
> Context engineering:
It's everything the model sees on a turn, not just the prompt. That includes the query, retrieved docs, memory, prior turns, and tool outputs from earlier steps.
The window is finite and fills up fast, so the engineering work is to rank inputs and cut everything that isn't pulling weight.
You do this by:
- Retrieving only the chunks relevant to the query, then reranking them
- Keeping key facts out of the middle, where accuracy drops
- Summarizing old turns, evict stale outputs, push big blobs to files
> Harness engineering:
It's the code around the model that defines the tools, parses the calls, retries on failure, and can route work to sub-agents so one handles retrieval and another handles code.
A verifier then grades the result by running tests, validating a schema, etc.
Prompt and context involve getting one call right. The harness involves everything that has to happen around that call for it to run in a real system.
> Loop engineering:
In the usual setup, you manage the outer loop, i.e, you write a prompt, read the turns the agent runs, write the next prompt, and repeat, while catching failures.
This layer hands that job to the agent itself. It kicks off on a schedule or an event, and runs many turns with no prompt in between.
A loop inherently doesn't know when it's finished. An agent can report that it's done and halt while the tests still fail. So the stop can't be the agent's word, but rather it has to be a real signal, like:
- A turn and token cap to stop stuck runs
- A no-progress detector to catch repeated calls
- A completion check to verify the goal with a separate model or a deterministic test
By this layer, you're operating on the whole run, so the engineering moves from writing each prompt to setting the goal and the stop conditions up front and letting it run.
If you want to dive deeper into loop engineering, my co-founder wrote a full breakdown of that outer loop.
It goes from the basic while loop to a run that finishes on its own, with the code behind each part, and the parts that are hard to get right, like knowing when to stop, context rot over a long run, and keeping the checker separate from the maker.
Read it below.
๐บ๐ธ๐ฎ๐ณ Apple ran from China and tripped in India
For years Apple guarded its supply chain like a state secret, and one hack just blew it open.
A ransomware crew called World Leaks broke into Tata Electronics, Apple's Indian manufacturer, and dumped 200,000 files onto the dark web, over 630 gigabytes.
Inside is what Apple never lets out, engineering drawings for the unreleased iPhone 18 Pro and a map of exactly which company makes which part, the detail it guards hardest from rivals and counterfeiters.
The irony writes itself. Apple moved production out of China to cut its risk, and India, the safer bet, is where its secrets walked out the door.
India now builds a quarter of the world's iPhones, which is a lot of Apple riding on a partner it's still learning to secure.
Source: Reuters, Al Jazeera / Writer: Daniyal
The CEO of Palantir sat across from Larry Fink - the man who runs BlackRock and its $11.5 TRILLION in assets - and told Davos the AI race is already lost by everyone pricing it wrong.
- he says the firms selling AI by the token have "completely broken" how it works
32-min from the Davos main stage on how AI redefines war, power and who actually controls capital
bookmark & watch - it's the most direct AI + power talk of the year
It took a little longer than expected, but we have created a website for people to view the footage collected from Gaza in one place. You no longer have to download the entire archives to see them.
It includes:
64,537 videos
17,905 photos
Ability to download individual videos
Searchable index
Exhaustive sources list (300+ journalists)
Geolocation data
Livemap with minute to minute updates
Victim list
It can be accessed here: https://t.co/s0Se94PXWF
Please share & quote tweet to help this post break out of the twitter algorithm prison.
We will keep adding the rest of the archives to the site, be patient- it is difficult work. Continue to seed the torrents provided, as that is the best way to ensure the footage remains stored in decentalized way.
God bless all those who sacrificed their lives to get this footage out, and everyone invovled in collecting/archiving it.
Join our telegram:
https://t.co/bvcis3b9GT
Follow our backup accounts:
@ZionismExposedx & @IsraelExposedAr
Elon Musk literally sat down for a 45-minute talk with Y Combinator that explains how to build world-changing companies better than any business school on earth. This is the advice he gave a room full of young founders:
1. Don't try to build something great. Try to build something useful.
Everyone obsesses over greatness. Musk says that's the wrong target. "I didn't originally think I would build something great. I wanted to try to build something useful. I didn't think I would build anything particularly great. Seemed unlikely, but I wanted to at least try." Aim for useful first. Greatness, if it comes, is a byproduct.
2. When you can't get in the front door, build your own door.
Before Musk started his first company, he tried to get a job at Netscape. "I sent my resume into Netscape and nobody responded. I tried hanging out in the lobby to see if I could bump into someone, but I was too shy to talk to anyone. So I'm like, this is ridiculous, I'll just write software myself." He didn't set out to be a founder. He became one because no one would hire him.
3. He slept in the office and showered at the YMCA.
The origin of his first company was not glamorous. "We couldn't even afford a place to stay. The office was 500 bucks a month, so we just slept in the office and showered at the YMCA." He couldn't afford proper internet either, so he drilled a hole through the office floor and ran a cable to the internet provider downstairs. That was the founder of the future richest man on earth.
4. Keep the chips on the table.
When Musk sold his first company, he received a $20 million cheque. His bank balance went from $10,000 to $20 million overnight. Most people would have stopped. He put almost all of it straight back into his next company. "I kept the chips on the table." He did the same thing decades later, over and over. He hates money sitting idle. Money is fuel for the next mission.
5. Start with the mission, then work backwards to make it a business.
Musk didn't start SpaceX to make money. He went on the NASA website to find out when humans were going to Mars, and there was no plan. So he decided to build one. "There had been no prior example of a rocket startup succeeding. A small chance of success is better than no chance of success." The mission came first. The business model came later.
6. He started SpaceX expecting to fail.
He is brutally honest about the odds. "SpaceX started in mid-2002 expecting to fail. Probably 90% chance of failing. When recruiting people, I said, we're probably going to die, but small chance we might not die." The first three launches failed. The fourth one worked with no money left. "If the fourth launch hadn't worked, it would have been curtains. We made it by the skin of our teeth."
7. Break every problem down to physics.
This is the core of how Musk thinks. "First principles means break things down to the fundamental elements that are most likely to be true, then reason up from there, as opposed to reasoning by analogy." His example is rockets. Everyone priced them based on what old rockets cost. Musk asked what a rocket is actually made of, priced the raw metals, and found the materials were only 1-2% of the historical price. The rest was inefficiency he could attack.
8. When told something takes 24 months, break it down and do it in six.
Last year xAI needed a giant computer to train its AI. Suppliers said it would take 18 to 24 months. "It's like, well, we need to get that done in six months or we won't be competitive." So he broke it into parts. Needed a building, so he found an old factory. Needed power, so he rented generators. Needed cooling, so he rented a quarter of America's mobile cooling capacity. He slept in the data centre and ran cabling himself. It got done.
9. Watch your ego-to-ability ratio.
Musk's single sharpest piece of advice for young founders is about staying honest with yourself. "A major failure mode is when your ego-to-ability ratio gets too high. Then you break the feedback loop to reality." Keep the ego small, internalise responsibility for everything, and stay ruthlessly connected to what's actually true. "You want to close the loop on reality hard. That's a super big deal."
10. Chase work, not glory.
His closing philosophy ties it all together. "It's so hard to be useful. The area under the curve of total utility is how useful you've been to your fellow human beings times how many people. If you aspire to do true work, your probability of success is much higher. Don't aspire to glory, aspire to work."
He was ridiculed for years. The press called him "internet guy attempting to build a rocket company." He agreed it sounded absurd. He did it anyway, because a small chance of doing something useful beat no chance at all.
Here's the thing though....
Musk became the most followed founder alive because everything he does happens in public. The launches, the failures, the talks like this one. The companies made him powerful. The personal brand made his every word travel around the world before he finishes saying it.
We build massive distribution and grow personal brands on X and beyond without our clients lifting a finger.
If you're a founder or VC looking for that kind of exposure, book a call below.
We average 1.5M views a week.
https://t.co/UoXuYlkBQq
AI & ML FREE Courses from Stanford:
โฏ CS336 - LLM from Scratch
โฏ CS221 - Artificial Intelligence
โฏ CS229 - Machine Learning
โฏ CS230 - Deep Learning
โฏ CS234 - Reinforcement Learning
โฏ CS224N - NLP with Deep Learning
All course links inside:
Opensource AI is now out of the bag!
This 19min CNBC interview with Palantir CEO not to be missed๐
If he is right, enterprises are starting to dump the frontier LLMs (Anthropic/OpenAI) for opensource, self hosted, data controlled versions... it's happening lock, stock & barrel.
This is an industry shift.... not an isolated, sporadic move.
Short term, Chinese models may gain... but long term new (non Chinese) opensource frontier options are bound to emerge!
urgh..."British families have suffered the biggest fall in wealth in the rich world since the pandemic. The average Britonโs wealth has fallen by 23% (both mean and median) over the past 5 years, in real terms, UBS calculates."
A guy who was the number one ranked machine learning competitor on Earth, twice, looked at how universities teach AI and decided they had the entire thing backwards.
So he built a free course that has turned more people into working AI practitioners than most graduate programs.
Jeremy Howard was the guy who made the course and it is called Practical Deep Learning for Coders.
Here is the argument that drives the whole thing.
Universities teach AI top-down. First you sit through linear algebra. Then calculus. Then probability. Then, maybe, a year later, you are finally allowed to touch a model. Howard watched this approach destroy motivated people. Most never made it to the part where it gets interesting. The math wall killed them first.
He thinks that is exactly wrong. His view is that you do not teach someone baseball by drilling the physics of a curveball for a year before letting them hold a bat. You let them play, then explain the physics once they care.
So his course inverts it. In the very first lesson, before any heavy theory, you train a working image classifier that actually runs. You build something real on day one. The theory comes later, pulled in piece by piece, exactly when you finally need it to go deeper.
Harvard Business Review said fast AI can take motivated students all the way to building industrial-grade AI systems.
The whole course is free. No paywall, no signup tricks.
It assumes you can code a little and remember some high school math. That's the bar.
The people who actually break into AI almost never start with the equations.
https://t.co/ea9S8yk1Cl