Skip to content

Instantly share code, notes, and snippets.

View hocyadav's full-sized avatar
😌
Working from home

Hariom Yadav hocyadav

😌
Working from home
View GitHub Profile

Your thinking is mostly correct. Here are some popular examples and their approaches:

  1. Google Search:

    • Approach: Semantic Search
    • Explanation: Uses natural language processing to understand the meaning of the query and find relevant documents, even if they don't contain the exact keywords.
    • Vector Database: Yes
  2. Google Image Search:

    • Approach: Similarity Search
  • Explanation: Finds images similar to the query image by comparing vector representations of images.

You:

I want to do small local spring boot poc on spring ai in Java gradle, I want to use database as some popular vector db, assume local LLM mode ollama l is running mistral, show me all code for how to connect to vector database that is running locally and also tell me what gradle dependency I need to add in spring boot project to connect to db

ChatGPT:

To create a Spring Boot project with Gradle that connects to a vector database (we'll use Pinecone as an example), and assumes a local LLM mode ollama l is running mistral, follow these steps:

Step 1: Set Up Spring Boot Project with Gradle

  • test

In the rapidly evolving world of financial technology, ensuring secure and seamless access to services remains a paramount challenge. Traditional authentication methods, heavily reliant on passwords and personal identifiers, no longer suffice in the face of sophisticated threats. Herein lies the potential for blockchain technology to redefine the paradigm of financial security.

Our hackathon project proposes a cutting-edge solution: a blockchain-based authentication framework designed to fortify financial transactions and access control. By leveraging the inherent security properties of blockchain—such as decentralization, immutability, and cryptographic verification—we aim to establish a new standard for authenticating user identities and transactions in the fintech sector.

  • slide 1: ✅
    • Comparing traditional databases, like SQL and NoSQL, with blockchain databases. -with each row representing an entity or record.
      • In traditional databases, an entity is a row in a table, capable of CRUD operations - Create, Read, Update, Delete.
      • Blockchain treats transactions as rows, but typically only allows Create and Read operations, making data immutable.
        • blockchain database, where each transaction is a record added to a growing list called a ledger.
    • transactions are verified in blockchain through consensus and are secured with cryptographic signatures, unlike traditional databases.
    • each transaction in a blockchain has metadata like timestamp and is linked to previous transactions, forming an immutable ledger
  • slide 2: ✅
    • centralized system, like a traditional company database, where one entity has control over all the data.
// migrations/2_deploy_contracts.js
const IdentityVerification = artifacts.require("IdentityVerification"); // contracts/IdentityVerification.sol
module.exports = function (deployer) {
deployer.deploy(IdentityVerification);
};
@hocyadav
hocyadav / MyBlockingQueue.java
Created December 27, 2023 09:59
prodcuer consumer pattern using own blocking queue
import lombok.SneakyThrows;
import java.util.LinkedList;
import java.util.Queue;
/**
* @author Hariom Yadav
* @since 05-Dec-2023
*/
public class MyBlockingQueue {
@hocyadav
hocyadav / ProducerConsumerPatternTest.java
Created December 27, 2023 09:50
simple producer consumer pattern impl
import org.junit.jupiter.api.Test;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Hariom Yadav
* @since 17-Nov-2023
*/
@hocyadav
hocyadav / EvenRunner.java
Created December 27, 2023 09:40
Even oddd print using 2 thread
import lombok.SneakyThrows;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Hariom Yadav
* @since 27-Dec-2023
*/
public class EvenRunner implements Runnable {
AtomicInteger atomic;