• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Tuesday, July 8, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    Build a just-in-time knowledge base with Amazon Bedrock

    Artificial Intelligence

    Transforming network operations with AI: How Swisscom built a network assistant using Amazon Bedrock

    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

  • Apple
    iPhone 17 Air rumor: New sky blue color

    iPhone 17 Air rumor: New sky blue color

    Apple @ Work Podcast: Fleet launches iOS device management

    Apple @ Work Podcast: Portability for Passkeys is coming to macOS

    macOS Tahoe 26 beta 3 now available, here’s what to expect

    macOS Tahoe 26 beta 3 now available, here’s what to expect

    Apple releases developer beta 3 for visionOS 26

    Apple releases developer beta 3 for visionOS 26

    Apple releases watchOS 26 beta 3, here’s what to expect

    Apple releases watchOS 26 beta 3, here’s what to expect

    Apple’s AI agent can describe Street View scenes to blind people

    Apple’s AI agent can describe Street View scenes to blind people

    Score AirPods from just $89

    Score AirPods from just $89

    Following hiccup, macOS 26 beta 3 now available for Apple Silicon

    Following hiccup, macOS 26 beta 3 now available for Apple Silicon

    Kingston IronKey Vault Privacy 80 review: Specs, features, price

    Kingston IronKey Vault Privacy 80 review: Specs, features, price

  • Gaming
    Police Checkpoint |As Dusk Falls Ep.25

    Police Checkpoint |As Dusk Falls Ep.25

    How to get the Amber Mutation in Grow a Garden

    How to get the Amber Mutation in Grow a Garden

    Diablo 4 Beta Review – Should It Be Delayed?

    Diablo 4 Beta Review – Should It Be Delayed?

    Turn your wall into the ultimate PC gaming display with these Prime Day Valerion projector deals

    Turn your wall into the ultimate PC gaming display with these Prime Day Valerion projector deals

    Sonic Frontiers: Was Update 2 ACTUALLY Good? Review

    Let's Talk About Gotham Knights’ Predictable Ending

    Let's Talk About Gotham Knights’ Predictable Ending

    Linus Torvalds has apparently met Bill Gates for the first time in person and before you ask, no he didn’t clock him in the face

    Racks packing Nvidia’s newest and shiniest AI supercomputer Blackwell Ultra cards have just been deployed by CoreWeave

    Gungrave G.O.R.E | Gameplay Walkthrough Part 32  No commentary (PC)

    Gungrave G.O.R.E | Gameplay Walkthrough Part 32 No commentary (PC)

    Linus Torvalds has apparently met Bill Gates for the first time in person and before you ask, no he didn’t clock him in the face

    This striking two-toned mini PC features a fully customised fanless cooling system for Framework and AMD’s new Halo Strix motherboards

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Long HDMI 2.1 Cable 30FT – 8K 60hz,Ultra High Speed HDMI Cable 4K 120hz…

    Long HDMI 2.1 Cable 30FT – 8K 60hz,Ultra High Speed HDMI Cable 4K 120hz…

    acer 7-in-1 Wireless Charging Station: Charger Stand for Multiple Devices for Apple -…

    acer 7-in-1 Wireless Charging Station: Charger Stand for Multiple Devices for Apple -…

    Rii RK100+ Multiple Color Rainbow LED Backlit Large Size USB Wired Mechanical Feeling…

    Rii RK100+ Multiple Color Rainbow LED Backlit Large Size USB Wired Mechanical Feeling…

    FC100 Gaming Headset with Microphone for PS4, PS5, Switch, Xbox, PC, Mac, Gamer Headset…

    FC100 Gaming Headset with Microphone for PS4, PS5, Switch, Xbox, PC, Mac, Gamer Headset…

    Killzone 2 – Playstation 3 (Renewed)

    Killzone 2 – Playstation 3 (Renewed)

    StarTech.com 10ft CAT6a Ethernet Cable – 10 Gigabit Shielded Snagless RJ45 100W PoE…

    StarTech.com 10ft CAT6a Ethernet Cable – 10 Gigabit Shielded Snagless RJ45 100W PoE…

    TAGRY Bluetooth Headphones True Wireless Earbuds 60H Playback LED Power Display…

    TAGRY Bluetooth Headphones True Wireless Earbuds 60H Playback LED Power Display…

    Samsung SSD 9100 PRO 4TB, PCIe 5.0×4 M.2 2280, Seq. Read Speeds Up to 14,800MB/s, Best…

    Samsung SSD 9100 PRO 4TB, PCIe 5.0×4 M.2 2280, Seq. Read Speeds Up to 14,800MB/s, Best…

    ORICO 2TB NVMe SSD PCIe 4.0 – Up to 7000MB/s, M.2 2280 Internal Solid State Drive, Fast…

    ORICO 2TB NVMe SSD PCIe 4.0 – Up to 7000MB/s, M.2 2280 Internal Solid State Drive, Fast…

  • Tesla
    Side View Mirror Cover with Tesla Cybertruck,Matte Carbon Fiber Pattern Rearview Mirror…

    Side View Mirror Cover with Tesla Cybertruck,Matte Carbon Fiber Pattern Rearview Mirror…

    For Tesla Model Y 2025 2026 Juniper& 2024-2025 Model 3 Highland Glossy Screen Protector…

    For Tesla Model Y 2025 2026 Juniper& 2024-2025 Model 3 Highland Glossy Screen Protector…

    Uireefly Center Console Wireless Charging Mat for Tesla Cybertruck 2024, Anti-Slip…

    Uireefly Center Console Wireless Charging Mat for Tesla Cybertruck 2024, Anti-Slip…

    Car Tow Hook Decor, V Shape Trailer Hook Sticker for Car Bumper, Auto Bumper Trailer Tow…

    Car Tow Hook Decor, V Shape Trailer Hook Sticker for Car Bumper, Auto Bumper Trailer Tow…

    Tesla employees try to oust Elon, new Volvo, and Micah’s close call

    America – it’s a party now! Plus: an electric Honda Ruckus!

    Heavy Duty D-Rings For Tesla Cybertruck 2023 2024 2025 4pcs Ring Truck Bed Hooks…

    Heavy Duty D-Rings For Tesla Cybertruck 2023 2024 2025 4pcs Ring Truck Bed Hooks…

    Tesla was forced to reimburse Full Self-Driving in arbitration after failing to deliver

    3D MAXpider Custom Fit Kagu Floor Mat (Black) Compatible with Tesla Model S 2021-2025 -…

    3D MAXpider Custom Fit Kagu Floor Mat (Black) Compatible with Tesla Model S 2021-2025 -…

    Tesla will pause part of new Model Y production for 3 weeks for upgrades, report says

    Elon Musk realized too late how badly Tesla will hurt from Trump’s bill

  • UFO
    Sun Halo A Natural Phenomena #viralvideo

    Sun Halo A Natural Phenomena #viralvideo

    BulbaCraft UFO Stickers, Alien Stickers for Water Bottle and Laptop – UFO Party Favors & Decorations, Waterproof Vinyl Decals, Gifts for Women & Men

    BulbaCraft UFO Stickers, Alien Stickers for Water Bottle and Laptop – UFO Party Favors & Decorations, Waterproof Vinyl Decals, Gifts for Women & Men

    I Married a Monster From Outer Space

    I Married a Monster From Outer Space

    Space Theme Birthday Candle, Shiny Astronaut Number Candle Spaceship Outer Space Cake Topper Perfect Universe Rocket Spacecraft Cake Decorations and Party Favors(Number 6)

    Space Theme Birthday Candle, Shiny Astronaut Number Candle Spaceship Outer Space Cake Topper Perfect Universe Rocket Spacecraft Cake Decorations and Party Favors(Number 6)

    Paranormal Phenomena: Modern Tales of the Unexplained

    Paranormal Phenomena: Modern Tales of the Unexplained

    Top 5 UFO Encounters of 2025 | New Evidence Emerges

    Top 5 UFO Encounters of 2025 | New Evidence Emerges

    Electric Disc Launcher with 6 Flying Spinners, Glow in The Dark Rechargeable Outdoor Play Fun Sport Fidget Toys

    Electric Disc Launcher with 6 Flying Spinners, Glow in The Dark Rechargeable Outdoor Play Fun Sport Fidget Toys

    UFO COMMUNITY IN A FRENZY – “Like Something Out Of An Alien Movie” | Proof Is Out There | #Shorts

    Evil Brain From Outer Space (Retro Cover Art) [DVD]

    Evil Brain From Outer Space (Retro Cover Art) [DVD]

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    Build a just-in-time knowledge base with Amazon Bedrock

    Artificial Intelligence

    Transforming network operations with AI: How Swisscom built a network assistant using Amazon Bedrock

    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

  • Apple
    iPhone 17 Air rumor: New sky blue color

    iPhone 17 Air rumor: New sky blue color

    Apple @ Work Podcast: Fleet launches iOS device management

    Apple @ Work Podcast: Portability for Passkeys is coming to macOS

    macOS Tahoe 26 beta 3 now available, here’s what to expect

    macOS Tahoe 26 beta 3 now available, here’s what to expect

    Apple releases developer beta 3 for visionOS 26

    Apple releases developer beta 3 for visionOS 26

    Apple releases watchOS 26 beta 3, here’s what to expect

    Apple releases watchOS 26 beta 3, here’s what to expect

    Apple’s AI agent can describe Street View scenes to blind people

    Apple’s AI agent can describe Street View scenes to blind people

    Score AirPods from just $89

    Score AirPods from just $89

    Following hiccup, macOS 26 beta 3 now available for Apple Silicon

    Following hiccup, macOS 26 beta 3 now available for Apple Silicon

    Kingston IronKey Vault Privacy 80 review: Specs, features, price

    Kingston IronKey Vault Privacy 80 review: Specs, features, price

  • Gaming
    Police Checkpoint |As Dusk Falls Ep.25

    Police Checkpoint |As Dusk Falls Ep.25

    How to get the Amber Mutation in Grow a Garden

    How to get the Amber Mutation in Grow a Garden

    Diablo 4 Beta Review – Should It Be Delayed?

    Diablo 4 Beta Review – Should It Be Delayed?

    Turn your wall into the ultimate PC gaming display with these Prime Day Valerion projector deals

    Turn your wall into the ultimate PC gaming display with these Prime Day Valerion projector deals

    Sonic Frontiers: Was Update 2 ACTUALLY Good? Review

    Let's Talk About Gotham Knights’ Predictable Ending

    Let's Talk About Gotham Knights’ Predictable Ending

    Linus Torvalds has apparently met Bill Gates for the first time in person and before you ask, no he didn’t clock him in the face

    Racks packing Nvidia’s newest and shiniest AI supercomputer Blackwell Ultra cards have just been deployed by CoreWeave

    Gungrave G.O.R.E | Gameplay Walkthrough Part 32  No commentary (PC)

    Gungrave G.O.R.E | Gameplay Walkthrough Part 32 No commentary (PC)

    Linus Torvalds has apparently met Bill Gates for the first time in person and before you ask, no he didn’t clock him in the face

    This striking two-toned mini PC features a fully customised fanless cooling system for Framework and AMD’s new Halo Strix motherboards

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Long HDMI 2.1 Cable 30FT – 8K 60hz,Ultra High Speed HDMI Cable 4K 120hz…

    Long HDMI 2.1 Cable 30FT – 8K 60hz,Ultra High Speed HDMI Cable 4K 120hz…

    acer 7-in-1 Wireless Charging Station: Charger Stand for Multiple Devices for Apple -…

    acer 7-in-1 Wireless Charging Station: Charger Stand for Multiple Devices for Apple -…

    Rii RK100+ Multiple Color Rainbow LED Backlit Large Size USB Wired Mechanical Feeling…

    Rii RK100+ Multiple Color Rainbow LED Backlit Large Size USB Wired Mechanical Feeling…

    FC100 Gaming Headset with Microphone for PS4, PS5, Switch, Xbox, PC, Mac, Gamer Headset…

    FC100 Gaming Headset with Microphone for PS4, PS5, Switch, Xbox, PC, Mac, Gamer Headset…

    Killzone 2 – Playstation 3 (Renewed)

    Killzone 2 – Playstation 3 (Renewed)

    StarTech.com 10ft CAT6a Ethernet Cable – 10 Gigabit Shielded Snagless RJ45 100W PoE…

    StarTech.com 10ft CAT6a Ethernet Cable – 10 Gigabit Shielded Snagless RJ45 100W PoE…

    TAGRY Bluetooth Headphones True Wireless Earbuds 60H Playback LED Power Display…

    TAGRY Bluetooth Headphones True Wireless Earbuds 60H Playback LED Power Display…

    Samsung SSD 9100 PRO 4TB, PCIe 5.0×4 M.2 2280, Seq. Read Speeds Up to 14,800MB/s, Best…

    Samsung SSD 9100 PRO 4TB, PCIe 5.0×4 M.2 2280, Seq. Read Speeds Up to 14,800MB/s, Best…

    ORICO 2TB NVMe SSD PCIe 4.0 – Up to 7000MB/s, M.2 2280 Internal Solid State Drive, Fast…

    ORICO 2TB NVMe SSD PCIe 4.0 – Up to 7000MB/s, M.2 2280 Internal Solid State Drive, Fast…

  • Tesla
    Side View Mirror Cover with Tesla Cybertruck,Matte Carbon Fiber Pattern Rearview Mirror…

    Side View Mirror Cover with Tesla Cybertruck,Matte Carbon Fiber Pattern Rearview Mirror…

    For Tesla Model Y 2025 2026 Juniper& 2024-2025 Model 3 Highland Glossy Screen Protector…

    For Tesla Model Y 2025 2026 Juniper& 2024-2025 Model 3 Highland Glossy Screen Protector…

    Uireefly Center Console Wireless Charging Mat for Tesla Cybertruck 2024, Anti-Slip…

    Uireefly Center Console Wireless Charging Mat for Tesla Cybertruck 2024, Anti-Slip…

    Car Tow Hook Decor, V Shape Trailer Hook Sticker for Car Bumper, Auto Bumper Trailer Tow…

    Car Tow Hook Decor, V Shape Trailer Hook Sticker for Car Bumper, Auto Bumper Trailer Tow…

    Tesla employees try to oust Elon, new Volvo, and Micah’s close call

    America – it’s a party now! Plus: an electric Honda Ruckus!

    Heavy Duty D-Rings For Tesla Cybertruck 2023 2024 2025 4pcs Ring Truck Bed Hooks…

    Heavy Duty D-Rings For Tesla Cybertruck 2023 2024 2025 4pcs Ring Truck Bed Hooks…

    Tesla was forced to reimburse Full Self-Driving in arbitration after failing to deliver

    3D MAXpider Custom Fit Kagu Floor Mat (Black) Compatible with Tesla Model S 2021-2025 -…

    3D MAXpider Custom Fit Kagu Floor Mat (Black) Compatible with Tesla Model S 2021-2025 -…

    Tesla will pause part of new Model Y production for 3 weeks for upgrades, report says

    Elon Musk realized too late how badly Tesla will hurt from Trump’s bill

  • UFO
    Sun Halo A Natural Phenomena #viralvideo

    Sun Halo A Natural Phenomena #viralvideo

    BulbaCraft UFO Stickers, Alien Stickers for Water Bottle and Laptop – UFO Party Favors & Decorations, Waterproof Vinyl Decals, Gifts for Women & Men

    BulbaCraft UFO Stickers, Alien Stickers for Water Bottle and Laptop – UFO Party Favors & Decorations, Waterproof Vinyl Decals, Gifts for Women & Men

    I Married a Monster From Outer Space

    I Married a Monster From Outer Space

    Space Theme Birthday Candle, Shiny Astronaut Number Candle Spaceship Outer Space Cake Topper Perfect Universe Rocket Spacecraft Cake Decorations and Party Favors(Number 6)

    Space Theme Birthday Candle, Shiny Astronaut Number Candle Spaceship Outer Space Cake Topper Perfect Universe Rocket Spacecraft Cake Decorations and Party Favors(Number 6)

    Paranormal Phenomena: Modern Tales of the Unexplained

    Paranormal Phenomena: Modern Tales of the Unexplained

    Top 5 UFO Encounters of 2025 | New Evidence Emerges

    Top 5 UFO Encounters of 2025 | New Evidence Emerges

    Electric Disc Launcher with 6 Flying Spinners, Glow in The Dark Rechargeable Outdoor Play Fun Sport Fidget Toys

    Electric Disc Launcher with 6 Flying Spinners, Glow in The Dark Rechargeable Outdoor Play Fun Sport Fidget Toys

    UFO COMMUNITY IN A FRENZY – “Like Something Out Of An Alien Movie” | Proof Is Out There | #Shorts

    Evil Brain From Outer Space (Retro Cover Art) [DVD]

    Evil Brain From Outer Space (Retro Cover Art) [DVD]

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

Enhance Vector Search with ColBERT Rerank

Hacker News by Hacker News
January 23, 2025
in Hacker News
Reading Time: 8 mins read
122
A A
0

2025-01-23 21:28:00
blog.vectorchord.ai

Traditional vector search methods typically employ sentence embeddings to locate similar content. However, generating sentence embeddings through pooling token embeddings can potentially sacrifice fine-grained details present at the token level. ColBERT overcomes this by representing text as token-level multi-vectors rather than a single, aggregated vector. This approach, leveraging contextual late interaction at the token level, allows ColBERT to retain more nuanced information and improve search accuracy compared to methods relying solely on sentence embeddings.

ColBERT structure (from the original paper)

As illustrated in the above image, ColBERT encodes each document/query into a list of token vectors and computes the MaxSim during the query time.

Token-level late interaction requires more computing power and storage. This makes using ColBERT search in large datasets challenging, especially when low latency is important.

One possible solution is to combine sentence-level vector search with token-level late interaction rerank, which leverages the efficiency of approximate vector search and the high quality of multi-vector similarity search.

The multi-vector approach is not limited to pure text retrieval tasks; it can also be used in visual document understanding. For multimodal retrieval models, state-of-the-art models like ColPali and ColQwen directly encode document images into multi-vectors and demonstrate stronger performance compared to OCR-to-text approaches.

This blog will demonstrate using the PostgreSQL extension VectorChord and pgvector with ColBERT rerank.

Tutorial

Assume we already have the documents, let’s create a table to store all of them:

import psycopg
from pgvector.psycopg import register_vector

class PgClient:
    def __init__(self, url: str, dataset: str, sentence_emb_dim: int, token_emb_dim: int):
        self.dataset = dataset
        self.sentence_emb_dim = sentence_emb_dim
        self.token_emb_dim = token_emb_dim
        self.conn = psycopg.connect(url, autocommit=True)
        with self.conn.cursor() as cursor:
            cursor.execute("CREATE EXTENSION IF NOT EXISTS vchord CASCADE;")
        register_vector(self.conn)

    def create(self):
        with self.conn.cursor() as cursor:
            cursor.execute(
                f"CREATE TABLE IF NOT EXISTS {self.dataset}_corpus "
                "(id INT BY DEFAULT AS IDENTITY PRIMARY KEY, text TEXT, "
                f"emb vector({self.sentence_emb_dim}), embs vector({self.token_emb_dim})[]);"
            )

Here we created a table with sentence-level embedding and token-level embeddings.

There are numerous embedding APIs and open-source models. You can choose the one that fits your use case.

For token-level embedding:

from colbert.infra import ColBERTConfig
from colbert.modeling.checkpoint import Checkpoint

class TokenEncoder:
    def __init__(self):
        self.config = ColBERTConfig(doc_maxlen=220, query_maxlen=32)
        self.checkpoint = Checkpoint(
            "colbert-ir/colbertv2.0", colbert_config=self.config, verbose=0
        )

    def encode_doc(self, doc: str):
        return self.checkpoint.docFromText([doc], keep_dims=False)[0].numpy()

    def encode_query(self, query: str):
        return self.checkpoint.queryFromText([query])[0].numpy()

ColBERT model produces 128-dim vectors by default.

To insert the data:

class PgClient:
    ...
    def insert(self, documents: list[str]):
        with self.conn.cursor() as cursor:
            for doc in tqdm(documents):
                sentence_emb = sentence_encoder.encode_doc(doc)
                token_embs = [emb for emb in token_encoder.encode(doc)]
                cursor.execute(
                    f"INSERT INTO {self.dataset}_corpus (text, emb, embs) VALUES (%s, %s, %s)"
                    (doc, sentence_emb, token_embs)
                )

For the vector search part, we can use VectorChord to build a high-performance RaBitQ index:

class PgClient:
    ...
    def index(self, num_doc: int, workers: int):
        n_cluster = 1 0.5 * 4))
        config = f"""
        residual_quantization = true
        [build.internal]
        lists = [{n_cluster}]
        build_threads = {workers}
        spherical_centroids = false
        """
        with self.conn.cursor() as cursor:
            cursor.execute(f"SET max_parallel_maintenance_workers TO {workers}")
            cursor.execute(f"SET max_parallel_workers TO {workers}")
            cursor.execute(
                f"CREATE INDEX {self.dataset}_rabitq ON {self.dataset}_corpus USING "
                f"vchordrq (emb vector_l2_ops) WITH (options = $${config}$$)"
            )

To speed up the indexing building process, we can utilize the external centroids build. Check “Benefits and Steps of External Centroids Building in VectorChord” for more details.

Now, we can query the PostgreSQL:

class PgClient:
    ...
    def query(self, doc: str, topk: int):
        sentence_emb = sentence_encoder.encode_query(doc)
        with self.conn.cursor() as cursor:
            cursor.execute(
                f"SELECT id, text FROM {self.dataset}_corpus ORDER BY emb  %s LIMIT {topk}"
            )
            res = cursor.fetchall()
        return res

To support MaxSim rerank, we’ll need to create a function:

class PgClient:
    def __init__(self, url: str, dataset: str, sentence_emb_dim: int, token_emb_dim: int):
        ...
        self.conn.execute("""
            CREATE OR REPLACE FUNCTION max_sim(document vector[], query vector[]) RETURNS double precision AS $$
            WITH queries AS (
                SELECT row_number() OVER () AS query_number, * FROM (SELECT unnest(query) AS query)
            ),
            documents AS (
                SELECT unnest(document) AS document
            ),
            similarities AS (
                SELECT query_number, document  query AS similarity FROM queries CROSS JOIN documents
            ),
            max_similarities AS (
                SELECT MAX(similarity) AS max_similarity FROM similarities GROUP BY query_number
            )
            SELECT SUM(max_similarity) FROM max_similarities
            $$ LANGUAGE SQL
        """)

Now, we can rerank the documents retrieved by vector search:

class PgClient:
    def rerank(self, query: str, ids: list[int], topk: int):
        token_embs = [emb for emb in token_encoder.encode_query(query)]
        with self.conn.cursor() as cursor:
            cursor.execute(
                f"SELECT id, text FROM {self.dataset}_corpus WHERE id = ANY(%s) ORDER BY "
                f"max_sim(embs, %s) DESC LIMIT {topk}"
                (ids, token_embs)
            )
            res = cursor.fetchall()
        return res

Evaluation

We have tested this method on several BEIR datasets. Here are the results:

DatasetSearch NDCG@10Rerank NDCG@10
fiqa0.232110.3033
quora0.315990.3934

This shows that ColBERT reranking can significantly enhance the results of vector searches.

All the related benchmark codes can be found here.

Future work

Vector search and full-text search with ColBERT rerank can further improve performance. We’re also working on the PostgreSQL BM25 extensions. Stay tuned.

References

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Support Techcratic

If you find value in Techcratic’s insights and articles, consider supporting us with Bitcoin. Your support helps me, as a solo operator, continue delivering high-quality content while managing all the technical aspects, from server maintenance to blog writing, future updates, and improvements. Support Innovation! Thank you.

Bitcoin Address:

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Please verify this address before sending funds.

Bitcoin QR Code

Simply scan the QR code below to support Techcratic.

Bitcoin QR code for donations

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share162Share28ShareShare4ShareTweet101
Previous Post

XRP, SOL, and DOGE ETFs Could See Faster Approval With SEC’s New Task Force, Strategist Says

Next Post

Samsung Galaxy S25 series has dormant satellite communication support

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

Welcome to the Two Towers Mud!
Hacker News

Welcome to the Two Towers Mud!

July 8, 2025
1.3k
BladedFeline Exploits Whisper and PrimeCache to Breach IIS and Microsoft Exchange Servers
Hacker News

BladedFeline Exploits Whisper and PrimeCache to Breach IIS and Microsoft Exchange Servers

July 7, 2025
1.3k
Introducing Tyr, a new Rust DRM driver
Hacker News

Introducing Tyr, a new Rust DRM driver

July 7, 2025
1.3k
New Slopsquatting Attack Exploits Coding Agent Workflows to Deliver Malware
Hacker News

New Slopsquatting Attack Exploits Coding Agent Workflows to Deliver Malware

July 7, 2025
1.3k
AiLock Ransomware Emerges with Hybrid Encryption Tactics: ChaCha20 Meets NTRUEncrypt
Hacker News

AiLock Ransomware Emerges with Hybrid Encryption Tactics: ChaCha20 Meets NTRUEncrypt

July 7, 2025
1.3k
joelburget/microjax: A tiny autograd engine with a Jax-like API
Hacker News

joelburget/microjax: A tiny autograd engine with a Jax-like API

July 7, 2025
1.3k
New Linux EDR Evasion Tool Exploits io_uring Kernel Feature
Hacker News

New Linux EDR Evasion Tool Exploits io_uring Kernel Feature

July 7, 2025
1.3k
The Era of Full-Stack Chip Designers
Hacker News

The Era of Full-Stack Chip Designers

July 7, 2025
1.3k
Load More
Next Post
Smartphone

Samsung Galaxy S25 series has dormant satellite communication support

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Forbes
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

OnePlus introduces Buds 4 and Watch 3 43mm

Welcoming Furry Joy!! Unleash Excitement as Adorable Puppies Find Home Sweet Home

iPhone 17 Air rumor: New sky blue color

Police Checkpoint |As Dusk Falls Ep.25

Buying a new Mac? Here’s why you should switch from a MacBook to a desktop

The best deals from Prime Day 2025

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Gaming
  • I Like Cats ™
  • I Like Dogs ™
  • MacRumors
  • Macworld
  • Tech Deals
  • Techcratic ™
  • Techs Got To Eat ™
  • Tesla
  • UFO
  • Wired