<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Fariq</title>
    <subtitle>Personal site of Fariq: software engineer working across fintech, LLMs, mobile apps, and business systems.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://fariq.space/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://fariq.space"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-04-28T00:00:00+00:00</updated>
    <id>https://fariq.space/atom.xml</id>
    <entry xml:lang="en">
        <title>ToolLoopAgent</title>
        <published>2026-04-28T00:00:00+00:00</published>
        <updated>2026-04-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/toolloopagent/"/>
        <id>https://fariq.space/writing/toolloopagent/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/toolloopagent/">&lt;p&gt;Today I learned about &lt;code&gt;ToolLoopAgent&lt;&#x2F;code&gt; while working with the Vercel AI SDK. It&#x27;s an abstraction where you define your tools and model, and it handles the agent loop automatically by calling the model, executing whichever tools it selects, feeding results back, and repeating until the task is complete.&lt;&#x2F;p&gt;
&lt;p&gt;I used it to build a chatbot for my company&#x27;s developer documentation. The docs are written in Markdown, then converted into a JSON file that the server loads on startup. The structure is just filename as key, trimmed and minified content as value:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;json&quot; class=&quot;language-json &quot;&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;{
  &amp;quot;docs&amp;#x2F;api&amp;#x2F;payments.md&amp;quot;: &amp;quot;# Payments API\n...&amp;quot;,
  &amp;quot;docs&amp;#x2F;guide&amp;#x2F;quickstart.md&amp;quot;: &amp;quot;# Quickstart\n...&amp;quot;
}
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This JSON acts as a virtual filesystem. The agent gets five tools to navigate it: &lt;code&gt;listFiles&lt;&#x2F;code&gt;, &lt;code&gt;searchFiles&lt;&#x2F;code&gt;, &lt;code&gt;searchLines&lt;&#x2F;code&gt;, &lt;code&gt;grepFiles&lt;&#x2F;code&gt;, and &lt;code&gt;readFile&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The prompt is pretty much like this:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;Your task is to help users find information in the documentation by:
1. Understanding their query
2. Using the documentation navigation files to choose the right source page
3. Reading the relevant endpoint or overview page before answering
4. Providing clear, accurate answers based on the documentation

Available Tools:
- Use &amp;#x27;listFiles&amp;#x27; to explore the directory structure. Pass {&amp;quot;path&amp;quot;: &amp;quot;.&amp;quot;} for root, or {&amp;quot;path&amp;quot;: &amp;quot;docs&amp;#x2F;api&amp;quot;} for subdirectories.
- Use &amp;#x27;searchFiles&amp;#x27; to find files containing a keyword (case-insensitive). Returns excerpts so you can choose the right file. Pass {&amp;quot;keyword&amp;quot;: &amp;quot;your search term&amp;quot;}.
- Use &amp;#x27;searchLines&amp;#x27; to search for plain text patterns across all files. Returns matching lines with file paths. Pass {&amp;quot;pattern&amp;quot;: &amp;quot;your pattern&amp;quot;}.
- Use &amp;#x27;grepFiles&amp;#x27; for advanced regex searches when plain text is not enough. Pass {&amp;quot;pattern&amp;quot;: &amp;quot;your regex&amp;quot;}.
- Use &amp;#x27;readFile&amp;#x27; to read the full contents of a file. Pass {&amp;quot;path&amp;quot;: &amp;quot;exact&amp;#x2F;file&amp;#x2F;path.md&amp;quot;}.
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The rest of the prompt is mostly guardrails to keep responses scoped to the docs. For small to medium datasets this works well (~200 Markdown files) because the memory footprint stays under 10MB while giving the agent fast in-memory access. We don&#x27;t need RAG here unless semantic understanding is critical to the use case.&lt;&#x2F;p&gt;
&lt;p&gt;To integrate with OpenRouter, I swapped the Vercel AI SDK for the OpenRouter Agent SDK. Fortunately they have the same function called &lt;code&gt;callModel&lt;&#x2F;code&gt; (&lt;a rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;openrouter.ai&#x2F;docs&#x2F;agent-sdk&#x2F;call-model&#x2F;overview&quot;&gt;docs&lt;&#x2F;a&gt;), which handles LLM calls with automatic tool execution.&lt;&#x2F;p&gt;
&lt;p&gt;For the model I decided to use &lt;code&gt;gpt-oss-120b&lt;&#x2F;code&gt;, and it&#x27;s surprisingly good at tool calling for the price, it returns accurate results and points to the right endpoints. With this approach I can keep the docs chatbot really cheap without a third party subscription.&lt;&#x2F;p&gt;
&lt;p&gt;This reminds me that the definition of an agent is actually pretty simple: an LLM running in a loop with access to tools, repeating until the job is done. Simon Willison covers it well &lt;a rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;simonwillison.net&#x2F;guides&#x2F;agentic-engineering-patterns&#x2F;what-is-agentic-engineering&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>AI, Coding and Crunch Time</title>
        <published>2026-02-14T00:00:00+00:00</published>
        <updated>2026-02-14T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/ai-coding-and-crunch-time/"/>
        <id>https://fariq.space/writing/ai-coding-and-crunch-time/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/ai-coding-and-crunch-time/">&lt;p&gt;I remember one of my stories related to crunch time. I was working on a back office system for an electrical company, and we were on a tight deadline. I had to deliver 3 big CRUD features, each with their own tables, forms, and validation logic. Each of the form contains 15-20 fields, with combination of text input, dropdown, date and file upload fields. All of them needed Excel export features with different formats, integrated into one big dashboard with multiple formulas to stitch the numbers together. Nothing intellectually hard, just an enormous amount of manual work that had to be done precisely and fast.&lt;&#x2F;p&gt;
&lt;p&gt;I remember locking myself in a hotel room for 3 days to finish this. Non stop typing from morning to 2am, stopping only to eat. After that I still had to provision a VPS from scratch, install the database, run the seed script, then prepare for the presentation on Monday morning. It was very tedious but somehow I still enjoyed it. I had maybe 2-3 instances of this happening pre AI era. From that crunch time I learn a ton. learned the intricacies of the language, how to create templates, some sysadmin stuff. The repetition builds muscle memory and tacit knowledge. The knowledge comes from the process.&lt;&#x2F;p&gt;
&lt;p&gt;That same project today is probably a few hours of good prompting. It&#x27;s nostalgic to remember it and amazing how AI changes that. Now the questions how will those crunch time look now ?&lt;&#x2F;p&gt;
&lt;p&gt;Well you don&#x27;t need to manually type the code anymore, but you still need to prompt it as clear as possible. Define the requirements, the test case, the limitations, the security constraints. Points your coding agent into the correct markdown (lols). You still need to check the LLM output, review the code, verify if the requirements actually implemented. You still need to test it manually, as shopisticated as agent browser may be, all the code, the resulting changes is still attached to your name. The struggle moved from hand to mind. You probably can do this in a morning in some coffee shop but the accountability is still there, and your cognitive load will be more spent because now you need to make multiple decisions faster.&lt;&#x2F;p&gt;
&lt;p&gt;We all need to adapt, and we will. It&#x27;s a disservice to your business to not use the best tools available, regardless of how you feel about it.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>AIs Before ChatGPT</title>
        <published>2025-11-07T00:00:00+00:00</published>
        <updated>2025-11-07T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/ais-before-chatgpt/"/>
        <id>https://fariq.space/writing/ais-before-chatgpt/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/ais-before-chatgpt/">&lt;p&gt;I recall the first time I experienced the black box magic of AI outside of LLMs.&lt;&#x2F;p&gt;
&lt;p&gt;I was given a task to prototype an employee shift scheduling webapp for a big hotel chain in Southeast Asia. My boss had already warned us that we could not use the usual for loops and if else logic. Come to think of it, this is something that requires a sophisticated solution. You need to automate a monthly schedule for 50+ employees. There are full timers who can work 40 hours and part timers at 20 hours, and these employees all have personal preferences. Some employees cannot work on Fridays, some have every Friday off, some are unavailable on Mondays every two weeks. These employees also need to be allocated shifts where each department has different shift lengths. housekeeping is only 4 hours, while front office needs to do 8 hours.&lt;&#x2F;p&gt;
&lt;p&gt;I tried to research the problem and found out it is actually an NP-hard problem called the Nurse Scheduling Problem. I came across Google OR-Tools, which is where I learned about the existence of SAT solvers. I then found OptaPlanner, a solution more suited to our needs since we had to integrate it with an existing Java webapp we had already built for those hotels. In there I learned about constraints and how to translate real world constraints into parts of the algorithm. It is a different way of thinking about code, you do not write a solution, but you write the shape of the problem, then you choose a search strategy to solve it. You can use brute force, or level up to more advanced solutions like genetic algorithms or simulated annealing.&lt;&#x2F;p&gt;
&lt;p&gt;After I developed the backend and plugged it into a frontend calendar, I was amazed by the magic of experiencing it as an end user who does not know what is happening in the backend. As an end user, you just input the constraints, hit generate, the backend works for one to three minutes, and then boom, the calendar is full of shifts. Magically all the constraints are fulfilled and you do not need to spend a full day juggling all the employee availability yourself. Like Clarke&#x27;s Third Law: any sufficiently advanced technology is indistinguishable from magic.&lt;&#x2F;p&gt;
&lt;p&gt;On a side note, OptaPlanner has since spun off into an independent startup called Timefold, founded around 2023, with a focus on scaling optimization solvers for enterprise use. I think they will succeed because these problems exist across many industries in the real world, and the solutions are genuinely useful.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My Final Year Project</title>
        <published>2025-08-29T00:00:00+00:00</published>
        <updated>2025-08-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/my-final-year-project/"/>
        <id>https://fariq.space/writing/my-final-year-project/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/my-final-year-project/">&lt;p&gt;My final year college project that decided whether or not I&#x27;d get my degree was building a knowledge base chatbot for my university. It was 2019, and I remember struggling quite a bit with the design early on, because it didn&#x27;t look anything like the typical systems I was used to building. The concept itself was straightforward: students ask questions about the university, the chatbot matches them against a curated knowledge base and returns the right answer, and if it doesn&#x27;t recognize something, it politely rejects it. It also couldn&#x27;t answer out-of-topic questions. This was years before ChatGPT, and before RAG was something people even knew about.&lt;&#x2F;p&gt;
&lt;p&gt;Fortunately we already had the Microsoft Bot Framework to make building a chatbot easier, but I still struggled to design a natural flow of conversation. So I went down the rabbit hole and discovered a glimpse of the NLP world in the pre ChatGPT era, starting with ELIZA, NLU, NER, and sentiment analysis.&lt;&#x2F;p&gt;
&lt;p&gt;My solution came after I discovered nlp.js (https:&#x2F;&#x2F;github.com&#x2F;axa-group&#x2F;nlp.js&#x2F;), a library for working with NLP in JavaScript. Simply put: you feed it question-answer pairs, it trains a small neural network on them, and the resulting model handles inference. I wrapped it in a REST API and plugged it into the Bot Framework.&lt;&#x2F;p&gt;
&lt;p&gt;I gathered the training data by interviewing students and staff, ending up with over 100 QA pairs covering everything people actually asked about the university. After testing it, I found the chatbot couldn&#x27;t recognize questions with the same semantic meaning but different wording. for example, &lt;em&gt;kapan terakhir pembayaran UKT?&lt;&#x2F;em&gt; and &lt;em&gt;deadline pembayaran UKT&lt;&#x2F;em&gt;. To mitigate this, I generated 5–10 variations of each QA pair and added them to the training data. It still couldn&#x27;t match GPT-3, but it answered correctly around 70% of the time.&lt;&#x2F;p&gt;
&lt;p&gt;Once it was live on the university website, I interviewed around 20 students about their experience. The results were decent enough to get me my degree.&lt;&#x2F;p&gt;
&lt;p&gt;Looking back, I sometimes wonder where things would&#x27;ve gone if I&#x27;d chased the AI path harder. But at the time, my only focus was making money as soon as possible, and I was already working remotely as a software developer a full year before I even graduated.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Ownership</title>
        <published>2025-05-18T00:00:00+00:00</published>
        <updated>2025-05-18T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/ownership/"/>
        <id>https://fariq.space/writing/ownership/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/ownership/">&lt;p&gt;What is ownership? It is something I first heard as a term from my manager when I first worked at a fintech that had many ex FAANG graduates. As a non native English speaker, it took me a while to understand, but eventually I did. It is what makes a software engineer effective, it differentiates low performers from high performers, and it is a must-have trait for high performing engineers.&lt;&#x2F;p&gt;
&lt;p&gt;Having a high sense of ownership means you treat the system as if it were your own. You make sure the code going into the system is proper, well tested, and performant. You observe the performance of the system regularly and escalate as soon as you find an error, and you make improvements so the system can work better and handle more requests per second. You do not need to be directed by your EM or PM to do this, and you do not need a Jira ticket to justify it.&lt;&#x2F;p&gt;
&lt;p&gt;A high sense of ownership also shows when you are working on a feature or project. It means making sure it is delivered on time, communicating early at the first signs of a looming delay, and making sure your collaborators share the same vision. You do not need to be a team lead to do this, you just have to be vocal and prove it with actions.&lt;&#x2F;p&gt;
&lt;p&gt;A high sense of ownership can also mean pushing back against managers who are trying to do something misinformed with the system, because you may know about consequences that are not obvious from the outside. As software engineers, you are the closest to the system, so you are the ones who best understand its emergent properties.&lt;&#x2F;p&gt;
&lt;p&gt;I grew up in a system designed to remove ownership from you. Eastern parenting most of the time means tiger parenting. Your parents decide what you should do, and you just need to spend as much time as possible studying according to their direction. School systems that only ask you to agree with the material and complete homework, where success is measured entirely by homework and exam results, reinforce this further. Shame culture makes you more passive and afraid to be seen negatively for pushing back or asking questions. Even my manager at my previous company could point out this distinction between engineers from the same country.&lt;&#x2F;p&gt;
&lt;p&gt;I have seen how low ownership plays out in a company. A big feature gets requested but the team lacks ownership, meaning less verification in production, less edge case testing, and it all leads to crunch time, incidents, and stress for everyone. Many of these traits were common in the ZIRP era, mainly because of cheap money and companies focusing on increasing headcount. But with COVID and the economic downturn, companies have become more ruthless. Teams are now expected to step up or step out, or the companies do not survive.&lt;&#x2F;p&gt;
&lt;p&gt;It is very important as software engineers to always strive for high ownership. It shows that you are reliable, it frees your manager from micromanaging you, and it proves you are worth what you are paid for.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On Writing</title>
        <published>2025-01-24T00:00:00+00:00</published>
        <updated>2025-01-24T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://fariq.space/writing/on-writing/"/>
        <id>https://fariq.space/writing/on-writing/</id>
        
        <content type="html" xml:base="https://fariq.space/writing/on-writing/">&lt;p&gt;Writing allows me think. It is how you map your mind onto the first layer of reality. But not all people like to writes and many now delegate their writings to LLMs, it just delegates their thinking. LLMs are already geniuses in datacenter but their output gravitates toward the average. Good writing gives good direction, and most good direction comes from original thought.&lt;&#x2F;p&gt;
&lt;p&gt;Human ability to write has accelerated civilizational progress. I remember in school they teach us the difference between prehistoric and historic age is where human learns to have written records. the invention of printing press revolutionize human civilization because it enabled mass production of written records and spread of knowledge. Writing is that important.&lt;&#x2F;p&gt;
&lt;p&gt;Writing immortalizes your ideas into the real world, and in some case, immortalizes parts of yourself. A single text can generate actions across centuries. ideas, culture, religion are better preserved through text. people may not know charles darwin as a person, may not even like him but they know evolution theory. same can be said with karl marx and communism.&lt;&#x2F;p&gt;
&lt;p&gt;I created this blog so i can share my writing. it allows people to take a glimpse into my thought without meeting me.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
