SShortSingh.
Back to feed

Vector Search Latency Spikes When Integrating RAGFlow's Memory Layer, and How to Fix It

0
·1 views

A developer integrating the open-source RAGFlow engine into an agent memory pipeline found that query latency rose from about 80ms to over 4 seconds at roughly 50 concurrent insertions per second, while recall dropped by 30%. The author attributed the problems to HNSW index locking in pgvector and improper embedding normalization. Their fixes included a dual-index schema, with IVFFlat for writes and HNSW for reads, plus asynchronous HNSW rebuilds. They also normalized embeddings to unit length at write time, which raised recall@10 from 0.68 to 0.91 on their test set. The post further describes a hybrid search approach that combines vector search with PostgreSQL full-text search using reciprocal rank fusion.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Go Realtime Channels Should Notify, Not Store, Logistics Device State

A realtime channel should deliver current logistics device events to authorized dashboard clients, but it should not serve as the record of those events. Durable device state belongs in a database or log, with a small notification published afterward so clients know what changed. On reconnect, clients should read from the durable source before resuming the live stream, since a reconnected socket does not prove missed updates were received. Connection tokens should be scoped to tenant, facility, and topic, because browser clients are untrusted even when their users are. The author also recommends separate service targets for durable ingestion and dashboard freshness, and testing the gap between them.

0
ProgrammingDEV Community ·

Deribit Gas Audit Finds About $2.5M in Potential Annual Savings

An independent audit examined Deribit's latest Ethereum mainnet deployment and its Optimism L2 contracts to assess gas efficiency. The review found several inefficiencies, including redundant storage operations, inefficient calldata encoding, and loop-based batch processing without early exits. Estimated combined savings across L1 and L2 reach roughly $2.5 million per year at current gas prices. The auditors reported no critical security flaws tied directly to gas usage, though some patterns could be abused to raise user transaction costs. Addressing these issues would also improve performance during periods of high network load.

0
ProgrammingDEV Community ·

Checkout failure alerting via polled logs and error APIs, with rollback kept separate

The article describes a checkout failure alerting design that polls logs and an errors API and evaluates the evidence in a shadow decision process before any action. Each checkout carries an operation ID through payment and reservation commit, and a poller normalizes records, saves source cursors, and checks a rolling window. Qualifying decisions produce durable alerts with idempotency keys, while an operator or separate controller verifies current reservation and payment state before any rollback. The author stresses that detection and control must stay separate, and that exception counts should never trigger rollback directly. The evidence contract is kept minimal, excluding guest names, addresses, payment data, and access tokens, and the decision threshold is passed in as a policy argument.

0
ProgrammingDEV Community ·

Generating Natural-Sounding Voice Content for E-Learning With Modern TTS

Engaging narration can improve learners' comprehension, retention, and satisfaction, which is pushing e-learning platforms away from static recordings toward AI-generated speech. Modern text-to-speech systems built on deep learning models produce expressive output, and they come in two forms: standard TTS using pre-trained voices, and voice cloning that replicates a specific speaker from a short audio sample. Both are available through REST APIs that can be integrated into course production workflows. The article walks developers through using ElevenLabs' API, covering account setup, secure storage of the API key, and a Python script that converts a lesson title and description into an MP3 file. A Node.js example is also provided for platforms built on that stack.

Vector Search Latency Spikes When Integrating RAGFlow's Memory Layer, and How to Fix It · ShortSingh