Using Generative AI to deliver projects faster (no gimmicks)

AI Adoption at Mantrax - No Gimmicks

In this article we will share how Mantrax is using Generative AI (when it makes sense) to improve productivity and deliver projects sooner. While we don’t want our developers to simply “ChatGPT” their way through projects, it is also undeniable that using Generative AI carefully can lead to productivity gains which in turn, deliver projects sooner and more economically. But there are also caveats to this approach. Buckle up as we walk you through our AI journey thus far.

3-step Process to Reduce Development Cost

Let’s say you have a table called products in your relational database for which you want to develop API endpoints. That is, you want to do the following:

  • Create new products 
  • Read/fetch all products or a specific product
  • Update a product
  • Delete a product

Step 1: Writing a good prompt for Generative AI

Prompt Engineering sits at the heart of all this. The quality of the generated output from Large Language Models (LLMs) like ChatGPT, LLaMA, Gemini etc, largely depends on how well you craft your prompts. Creating a perfect prompt takes time and it is an iterative process. 

Here is a basic prompt to get some boilerplate code for a developer to get started on this API project.

(Psst… What differentiates this outcome from a generic outcome is our hand-written sample code)

					Can you generate CRUD endpoints for a PostgreSQL table called 'products' in TypeScript. Please use Sequelize ORM and error handling. Put emphasis on code quality and match coding standards as shown below:

/*** Our secret sauce goes here: Sample Code written at Mantrax ***/

'products' table has fields:

id: serial PK 
name: varchar 
product_number: integer 
category: varchar 
country_of_origin: varchar 
vendor_name: varchar 
vendor_website: varchar 
created_ts: timestampz
updated_ts: timestampz


				

Step 2: Validating the LLM output

The output from the LLM for this prompt is carefully reviewed by a tech lead and once approved, it will be passed on to the developer. However, if a tweak is necessary to the prompt (doesn’t happen frequently), it is carefully documented and socialized with our AI team. The idea is to iteratively write the optimal prompt, but also not to over-engineer the prompts.

LLM Output
Model: https://huggingface.co/chat/settings/meta-llama/Llama-3.3-70B-Instruct

Step 3: Use AI generated code to create a feature branch in Git

At this stage, it is up to the developer to examine, modify and integrate this code generated by the LLM into the project’s code base via a feature branch. Once the code has passed unit testing, it goes through our pull request review process where other developers (manually) review the code to make sure there are no mistakes. If the code meets our rigorous standards, it gets merged to the development branch for further testing by QA analysts and the product owner. 

And that’s it!

What would have taken  two to three days to finish, now takes a little over a day to complete.

Approximate Savings: 30-40%, as real life examples are rarely this simple 😉

Busting some AI Myths

At this point, everything looks nice and dandy and you might be wondering one of two things:

  1. Do you even need us
  2. Why are we telling you all this, don’t we have a moat

With a steady stream of social media content from “AI pundits”, there are a lot of misconceptions about what AI can and cannot do.

Myth #1

Claim: AI can do everything. Developers will be obsolete by this time next year.

Reality: While LLMs have come a long way, they are still dependent on context. Creation of that context is still largely a human endeavour. AI generated code only gives us a head start; it is neither perfect nor does it take us to the finish line. There can be hard-to-code exceptions, highly convoluted business logic, for which, human intervention (developer, BA, QA) is still very much required. Just look at the screenshot below. Sequelize is a very popular ORM package for Node JS applications. Generated code from the LLM, labelled it is a equalize and not the correct package name, which is sequelize.
LLM Output with typo

Myth #2

Claim: I can write a simple website using AI in a few hours. And I don't even have to know programming!

Reality: Not quite! Unless it’s a brochure site without any data-driven content, you will either need to know some programming, or use a low-code/no-code platform (which just hide the complexities from you).

And the most popular one …

Myth #3

Claim: AI based tools can generate complex applications in weeks, not months.

Reality: Complexity is a relative term and timelines depend on scope. Such ambitious claims can garner social media “likes”, but are rarely authentic. Without coding standards and organization in place, you run the risk of having undocumented and obfuscated code at hand which can choke your application when it comes to scaling and performance..

Responsible Adoption of AI at Mantrax

At Mantrax, we believe that AI tools are there to boost developer productivity, not remove them completely. In order for us to grow as an organization, we need to keep ourselves sharp, and invest in learning and development.  

Here are some of the restrictions we have put in place to adopt AI more responsibly:

  • Test-driven Development: Writing unit tests using AI is a bad idea. It is possible to do so, but writing unit tests without business rules or context does not add much value. Test Driven Development (TDD) at Mantrax is not performed using AI. 
  • Discourage usage of OpenAI (ChatGPT): When you’re prompting ChatGPT to get some code samples or content, your prompts (queries) are sent to OpenAI in the request. Nobody truly knows what happens to the prompt, how is it used (if used), where is it saved and who has access to it. For this reason, we don’t use OpenAI and other API-based LLMs for anything which reveals your data. 
  • Don’t rely too much on AI: While there are substantial benefits to leveraging AI from a productivity standpoint, we don’t want to build our trade relying on these tools to the point where we cannot survive without them. Programming is not a spectator sport. One gets proficient at it by actually writing code (not copy-pasting). It would be a dangerous move to encourage heavy usage of Gen AI for near-term gains. 

If you liked our AI adoption policy, and philosophy, let’s have a quick chat to see if Mantrax is the right team for your next project. Email us at info@mantrax.io with any questions you may have. We are happy to provide you a free 30-minute no obligation consulting call.

Feature photo by Brett Jordan on Unsplash

Recommended Posts

No comment yet, add your voice below!


Add a Comment

Your email address will not be published. Required fields are marked *