<?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>Forem: Ayush Deb</title>
    <description>The latest articles on Forem by Ayush Deb (@ayushdeveloper).</description>
    <link>https://forem.com/ayushdeveloper</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%2F769572%2Fe5ca6ab0-58c7-4ed7-a988-2d845adca03f.jpeg</url>
      <title>Forem: Ayush Deb</title>
      <link>https://forem.com/ayushdeveloper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ayushdeveloper"/>
    <language>en</language>
    <item>
      <title>Research AI Assistant Application - RAG</title>
      <dc:creator>Ayush Deb</dc:creator>
      <pubDate>Sat, 09 Nov 2024 21:14:50 +0000</pubDate>
      <link>https://forem.com/ayushdeveloper/research-ai-assistant-application-rag-3d0m</link>
      <guid>https://forem.com/ayushdeveloper/research-ai-assistant-application-rag-3d0m</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/pgai"&gt;Open Source AI Challenge with pgai and Ollama &lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I created an AI-powered research assistant application designed to make finding and understanding relevant research papers much easier. When you’re writing a research paper, it’s often a struggle to locate high-quality papers that match your topic closely. This app streamlines that process. It first searches and pulls up research papers closely aligned with your query, and then leverages LLM (Large Language Models) and RAG (Retrieval-Augmented Generation) to generate insightful summaries, suggested responses, and information based on your specific prompt. Not only does it provide summaries, but it also includes links, titles, and other essential details for each recommended paper, so you can get a comprehensive view of what's available. This tool essentially simplifies the process of gathering and interpreting research, helping you focus more on writing and analysis than on the hunt for resources.&lt;/p&gt;

&lt;p&gt;Key Features : - &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Relevant Paper Discovery: Quickly finds research papers closely related to your topic or query.&lt;/li&gt;
&lt;li&gt;Intelligent Summarization: Uses Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) to generate clear, concise summaries for each paper.&lt;/li&gt;
&lt;li&gt;Prompt-Based Response Generation: Provides insightful responses and context-specific information based on your prompt, helping you understand complex topics.&lt;/li&gt;
&lt;li&gt;Link and Title Integration: Includes direct links, titles, and summaries of recommended papers, saving you time and ensuring easy access to source material.&lt;/li&gt;
&lt;li&gt;User-Friendly Interface: Simplifies the research process, allowing you to focus on writing and analysis rather than sourcing information.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjzevx883m7uurwxu9in.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjzevx883m7uurwxu9in.png" alt="The query response : Part1 " width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dx74qjragvxsz642l6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dx74qjragvxsz642l6d.png" alt="The query response : Part2" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is my Github Link : - &lt;a href="https://github.com/Ayush-developer/Reasearch_Assistant_RAG_Application" rel="noopener noreferrer"&gt;https://github.com/Ayush-developer/Reasearch_Assistant_RAG_Application&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Timescale Cloud: Database hosting&lt;/li&gt;
&lt;li&gt;pgai through TimescaleDB for AI&lt;/li&gt;
&lt;li&gt;pgVector: For efficient data storage and retrieval of embeddings&lt;/li&gt;
&lt;li&gt;Ollama: For generating embeddings and handling response generation using Mistral and LLama &lt;/li&gt;
&lt;li&gt;React.js: Used for building the user interface&lt;/li&gt;
&lt;li&gt;Flask API ; - For backend API Handling&lt;/li&gt;
&lt;li&gt;Postman : - Testing Queries&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technologies Used : -
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Ollama with Nomic Embeddings: Utilizes Nomic embeddings for accurate text representation, supporting semantic search and relevance scoring for research queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PostgreSQL with PG Vector and Psycopg2: Stores embeddings in PostgreSQL using pgvector, enabling efficient similarity searches, with psycopg2 managing database connections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Llama Model via Ollama: Leverages the Llama model for natural language processing, generating precise responses and summaries based on user queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Flask API for Backend: Manages backend processing and data flow between the frontend and AI models, ensuring smooth interaction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React for Frontend: Provides a responsive, intuitive interface for query input, viewing results, and accessing summaries.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is my first time participating in a Dev.to Hackathon, and it’s been an incredible learning experience! Building this AI application has opened my eyes to so many new technologies, from working with Large Language Models and embeddings to managing backend integrations. I’m still figuring out deployment and improving the application’s functionality, so I’d love to connect with anyone willing to help or share advice. As a 4th-year student currently interning with React, this project marked my first foray into advanced AI and NLP, and I’m grateful for the opportunity to showcase my work and grow through this experience. Thank you for creating such an encouraging platform!&lt;/p&gt;

&lt;p&gt;Prize Categories:&lt;br&gt;
Open-source Models from Ollama: AI Bot leverages Ollama’s open-source models for embedding and understanding text-based queries.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>pgaichallenge</category>
      <category>database</category>
      <category>ai</category>
    </item>
    <item>
      <title>Create a Full Stack Mern Social Media Application - Part 2</title>
      <dc:creator>Ayush Deb</dc:creator>
      <pubDate>Mon, 14 Oct 2024 21:43:24 +0000</pubDate>
      <link>https://forem.com/ayushdeveloper/create-a-full-stack-mern-social-media-application-part-2-hl6</link>
      <guid>https://forem.com/ayushdeveloper/create-a-full-stack-mern-social-media-application-part-2-hl6</guid>
      <description>&lt;p&gt;So it looks like this series is going to be long if I have to put every single detail here. But if it can help somebody I am up for it . &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Configure the file storage on your index.js
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;FILE STORAGE&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;const storage = multer.diskStorage({&lt;br&gt;
  destination: function (req, file, cb) {&lt;br&gt;
    cb(null, "public/assets");&lt;br&gt;
  },&lt;br&gt;
  filename: function (req, file, cb) {&lt;br&gt;
    cb(null, file.originalname);&lt;br&gt;
  },&lt;br&gt;
});&lt;br&gt;
const upload = multer({ storage });&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores files in the "public/assets" folder.&lt;/li&gt;
&lt;li&gt;Keeps the original file name when saving the uploaded file.&lt;/li&gt;
&lt;li&gt;Multer is configured to handle these uploads in your app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Configure MongoDB Atlas
&lt;/h2&gt;

&lt;p&gt;Create and configure a MongoDB Atlas server.&lt;/p&gt;

&lt;p&gt;Create a .env file and put the mongodb url along with your password inside the url. &lt;/p&gt;

&lt;p&gt;Put the port number&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create the Auth.js file
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use brcypt to hash the password and create the user with all credentials and details. &lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;Use jsonwebtoken or 'jwt' for authentication &lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;li&gt;import user module from the userSchema made using mongoose. &lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Create a Full Stack Mern Social Media Application - Part 1</title>
      <dc:creator>Ayush Deb</dc:creator>
      <pubDate>Thu, 10 Oct 2024 06:01:59 +0000</pubDate>
      <link>https://forem.com/ayushdeveloper/create-a-full-stack-mern-social-media-application-part-1-47f5</link>
      <guid>https://forem.com/ayushdeveloper/create-a-full-stack-mern-social-media-application-part-1-47f5</guid>
      <description>&lt;p&gt;Hi Guys, &lt;/p&gt;

&lt;p&gt;This is my first full stack applications to put all my skills to use and highlight this in my resume to crack a full time Software Developer Role. So this is how I started. &lt;/p&gt;

&lt;p&gt;First we are creating our server then we will code our client side.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;SERVER&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install all the Dependencies &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How to : - npm - i express brcypt ....&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;express&lt;/li&gt;
&lt;li&gt;body-parser &lt;/li&gt;
&lt;li&gt;bcrypt &lt;/li&gt;
&lt;li&gt;cors&lt;/li&gt;
&lt;li&gt;dotenv&lt;/li&gt;
&lt;li&gt;gridfs-stream&lt;/li&gt;
&lt;li&gt;multer-gridfs-storage&lt;/li&gt;
&lt;li&gt;helmet&lt;/li&gt;
&lt;li&gt;morgan&lt;/li&gt;
&lt;li&gt;jsonwebtoken&lt;/li&gt;
&lt;li&gt;mongoose&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create a index.js file with importing all the dependencies&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;import express from "express";&lt;br&gt;
import bodyParser from "body-parser";&lt;br&gt;
import mongoose from "mongoose";&lt;br&gt;
import cors from "cors";&lt;br&gt;
import dotenv from "dotenv";&lt;br&gt;
import multer from "multer";&lt;br&gt;
import helmet from "helmet";&lt;br&gt;
import morgan from "morgan";&lt;br&gt;
import path from "path";&lt;br&gt;
import { fileURLToPath } from "url";&lt;/p&gt;

&lt;p&gt;Note: - fileURLToPath in Node.js is a function that takes a special kind of URL (called a file URL) and turns it into a regular file path that your operating system can understand.&lt;/p&gt;

&lt;p&gt;For example, a URL like file:///C:/path/to/file isn't something you can directly use with file system functions in Node.js, but by using fileURLToPath, it becomes something like C:\path\to\file on Windows or /path/to/file on Linux&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding the configurations &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. const __filename = fileURLToPath(import.meta.url);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This converts the file's URL (which is provided by import.meta.url) into a path that the operating system understands.&lt;/p&gt;

&lt;p&gt;Why it's used: It helps you get the full file path of the current file, which is especially useful in ES modules where __filename isn't available by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. const &lt;strong&gt;dirname = path.dirname(&lt;/strong&gt;filename);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This extracts the directory name of the current file from the file path.&lt;/p&gt;

&lt;p&gt;Why it's used: It allows you to know the directory where the current file is located, which is useful for working with relative paths (e.g., serving static files).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. dotenv.config();&lt;/strong&gt;&lt;br&gt;
What it does: This loads environment variables from a .env file into process.env.&lt;/p&gt;

&lt;p&gt;Why it's used: It helps you securely store configuration like API keys and database URLs in an external file without hardcoding them into your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. const app = express();&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This creates an Express application instance.&lt;/p&gt;

&lt;p&gt;Why it's used: Express is a framework for building web servers and APIs. This line initializes the app so you can start adding routes and middleware.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. app.use(express.json());&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: It allows the Express app to automatically parse incoming JSON requests (for example, when someone sends JSON data in a POST request).&lt;/p&gt;

&lt;p&gt;Why it's used: This makes it easier to handle JSON data in your API or web server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. app.use(helmet());&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: Helmet is a middleware that adds security-related HTTP headers to your app.&lt;/p&gt;

&lt;p&gt;Why it's used: It helps improve security by setting headers that protect against various web vulnerabilities like cross-site scripting (XSS) and clickjacking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. app.use(helmet.crossOriginResourcePolicy({ policy: "cross-origin" }));&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This adds a policy to allow resources from your server to be accessed by external domains (cross-origin).&lt;/p&gt;

&lt;p&gt;Why it's used: It provides a layer of control over what resources can be shared across different websites, while still maintaining security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. app.use(morgan("common"));&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: Morgan is a middleware for logging HTTP requests. Here, it’s set to log in the "common" format.&lt;/p&gt;

&lt;p&gt;Why it's used: It helps track incoming requests for debugging, analytics, or monitoring purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. app.use(bodyParser.json({ limit: "30mb", extended: true }));&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This allows the app to handle large JSON payloads (up to 30MB) in incoming requests.&lt;/p&gt;

&lt;p&gt;Why it's used: If your app is expected to receive large JSON data (e.g., file uploads), you increase the limit so the app can process it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. app.use(bodyParser.urlencoded({ limit: "30mb", extended: true }));&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This is similar to the previous line but handles URL-encoded data (like form submissions).&lt;/p&gt;

&lt;p&gt;Why it's used: It allows your app to process form submissions with larger amounts of data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. app.use(cors());&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: CORS (Cross-Origin Resource Sharing) middleware enables your app to accept requests from other domains.&lt;/p&gt;

&lt;p&gt;Why it's used: It's necessary if you're building an API or web app that will be accessed from a different domain, such as a front-end app hosted separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. app.use("/assets", express.static(path.join(__dirname, "public/assets")));&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What it does: This serves static files (like images, CSS, or JavaScript) from the public/assets directory at the /assets path.&lt;/p&gt;

&lt;p&gt;Why it's used: It allows users or browsers to access these files directly by visiting &lt;a href="http://yourdomain.com/assets/filename" rel="noopener noreferrer"&gt;http://yourdomain.com/assets/filename&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
