<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ankush Thakur</title>
    <description>The latest articles on DEV Community by Ankush Thakur (@ankusht2307).</description>
    <link>https://dev.to/ankusht2307</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F609698%2Fec18e6c9-976e-4487-9d8a-e1d17e71d050.jpeg</url>
      <title>DEV Community: Ankush Thakur</title>
      <link>https://dev.to/ankusht2307</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankusht2307"/>
    <language>en</language>
    <item>
      <title>Making sense of PDFs with AI: Why we need both Sentence-BERT and FAISS</title>
      <dc:creator>Ankush Thakur</dc:creator>
      <pubDate>Thu, 21 Aug 2025 15:52:21 +0000</pubDate>
      <link>https://dev.to/ankusht2307/making-sense-of-pdfs-with-ai-why-we-need-both-sentence-bert-and-faiss-3kh5</link>
      <guid>https://dev.to/ankusht2307/making-sense-of-pdfs-with-ai-why-we-need-both-sentence-bert-and-faiss-3kh5</guid>
      <description>&lt;p&gt;When I first started exploring question-answering on PDFs, one thing confused me:&lt;br&gt;
👉 Why do we use Sentence-BERT and FAISS together?&lt;br&gt;
Can’t FAISS just create embeddings on its own?&lt;/p&gt;

&lt;p&gt;Here’s the simple breakdown 👇&lt;/p&gt;

&lt;p&gt;🔹 Sentence-BERT&lt;/p&gt;

&lt;p&gt;It’s a neural network model.&lt;/p&gt;

&lt;p&gt;Converts text into embeddings (vectors of numbers).&lt;/p&gt;

&lt;p&gt;These vectors capture the meaning of the text.&lt;/p&gt;

&lt;p&gt;Example: “dog” and “puppy” → end up with vectors close to each other.&lt;/p&gt;

&lt;p&gt;🔹 FAISS (Facebook AI Similarity Search)&lt;/p&gt;

&lt;p&gt;It doesn’t create embeddings.&lt;/p&gt;

&lt;p&gt;Instead, it’s an efficient search engine for vectors.&lt;/p&gt;

&lt;p&gt;Given a query vector, it finds the nearest neighbors (most similar chunks of text) super fast.&lt;/p&gt;

&lt;p&gt;👉 Think of it like this:&lt;/p&gt;

&lt;p&gt;Sentence-BERT = Translator (text → coordinates on a “map of meaning”)&lt;/p&gt;

&lt;p&gt;FAISS = GPS (finds the closest points on that map in milliseconds)&lt;/p&gt;

&lt;p&gt;💡 Together, they make semantic search possible:&lt;/p&gt;

&lt;p&gt;Sentence-BERT gives us the “language of meaning” (embeddings)&lt;/p&gt;

&lt;p&gt;FAISS makes searching through thousands or millions of embeddings lightning fast&lt;/p&gt;

&lt;p&gt;Without Sentence-BERT → FAISS has nothing meaningful to compare.&lt;br&gt;
Without FAISS → you can still compare embeddings, but it’s painfully slow at scale.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>NextJs TypeScript setup with Prettier, Husky.</title>
      <dc:creator>Ankush Thakur</dc:creator>
      <pubDate>Wed, 14 Jun 2023 20:06:07 +0000</pubDate>
      <link>https://dev.to/ankusht2307/nextjs-typescript-setup-with-prettier-husky-3dih</link>
      <guid>https://dev.to/ankusht2307/nextjs-typescript-setup-with-prettier-husky-3dih</guid>
      <description>&lt;p&gt;Let's get started with the NextJs setup with TypeScript. The configuration will be scalable with added configurations.&lt;/p&gt;

&lt;p&gt;Let's create our app first by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be presented with options. You can select each according to your preferences.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is your project named? nextJs-awesome-setup
Would you like to use TypeScript with this project? No / Yes
Would you like to use ESLint with this project? No / Yes
Would you like to use Tailwind CSS with this project? No / Yes
Would you like to use `src/` directory with this project? No / Yes
Use App Router (recommended)? No / Yes
Would you like to customise the default import alias? No / Yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Till now every step was generic which you can also find from &lt;a href="https://nextjs.org/docs/getting-started/installation"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Deleting &lt;code&gt;package.lock.json&lt;/code&gt; file and &lt;code&gt;node_modules&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have now converted our app to support &lt;code&gt;yarn&lt;/code&gt; instead of &lt;code&gt;npm&lt;/code&gt;. Which will be quite beneficial in the longer run.&lt;/p&gt;

&lt;p&gt;Try running &lt;code&gt;yarn dev&lt;/code&gt; to check if everything is working as expected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Prettier configuration&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add -D prettier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install the required dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .prettierrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create configuration file for Prettier where you can define your own custom rules.&lt;br&gt;
Some common rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "semi": true,
  "trailingComma": "none",
  "singleQuote": true,
  "printWidth": 80
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste these rules as is in the &lt;code&gt;.prettierrc&lt;/code&gt; file we have just created.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Create &lt;code&gt;.prettierignore&lt;/code&gt; to ignore certain files and folders&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .prettierignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;node_modules&lt;/code&gt; and &lt;code&gt;.next&lt;/code&gt; folders&lt;/p&gt;

&lt;p&gt;Add this line in &lt;code&gt;package.json&lt;/code&gt; under scripts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"format": "npx prettier --write ."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can finally test if it works, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn format
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope, it worked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Husky configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some information about &lt;a href="https://typicode.github.io/husky/"&gt;husky&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;husky&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install husky --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable &lt;code&gt;git&lt;/code&gt; hooks
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx husky install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;To automatically have Git hooks enabled after install, edit &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm pkg set scripts.prepare="husky install"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running this you should have this in your &lt;code&gt;package.json&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "scripts": {
    "prepare": "husky install" 
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Create a hook&lt;/em&gt; which gets triggered whenever you make a commit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx husky add .husky/pre-commit "yarn format"
git add .husky/pre-commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now whenever you do a new commit, your code should format itself before commit.&lt;/p&gt;

&lt;p&gt;Bonus point: You run any script here using &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; and it will execute whenever you make commit for example your can run test every time before you make commit by adding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn format &amp;amp;&amp;amp; yarn test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TLDR! This setup guide offers you code formatting and check before making a commit, so that you don't push anything that looks bad.&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
