Fixed WeKnora's /api/ responses hanging in Chrome 154 — a one-line nginx fix restoring chunked transfer encoding, proven on a live proxy test. WeKnora#4949 #OpenSource #WebDev #nginx
5 views
50×3=150 个数据库连接名额。
知识库平台 WeKnora 今天主分支加了连接池上限,限制每个实例的连接数。
你照抄示例的 50,三台服务就可能挤爆只有 100 个名额的数据库。连接预算得按副本分,给运维也留几个。
#Agent工程
github.com/Tencent/WeKnora/commit/4cfb929df6f209f…
11 views
9 'Free' AI & Dev Repos: Only 5 Are Actually Free
A viral reel lists nine 'free' GitHub repos that replace paid software and implies you'll save hundreds a month. All nine are real, but 'free' needs an asterisk, so here's the honest sort (stars and prices at time of filming).
Genuinely free and self-hosted: Cap (replaces Loom), Chatwoot (Intercom), OpenProject (Asana, Community Edition), OpenWhispr (Wispr Flow), and VoiceStudio (ElevenLabs-style voice cloning that runs locally). Download, run, done.
Free app, but you still pay someone: OpenSEO replaces the Semrush subscription but needs a paid DataForSEO API key (pay-as-you-go, $50 minimum top-up), so you pay per lookup; and open-higgsfield is a free UI that calls Higgsfield's own API and spends credits on your paid Higgsfield account.
Read the licence first: the fully-free Calendly self-host is the Cal.diy fork, whose README says personal, non-production use only (commercial Cal.com is open-core); and WeKnora is a local document-Q&A (RAG) tool that can read your Notion, not a Notion-workspace replacement.
And every one means you run the server, updates, backups and security yourself. The reel's on-screen savings total only counts five of the nine tools and doesn't even add up, so treat savings as 'could', not 'will'. Still, five solid freebies is a genuinely good haul.
Sources (checked 22 Oct 2026):
Cap (replaces Loom): CapSoftware/Cap
Chatwoot (Intercom): chatwoot/chatwoot
OpenProject (Asana): opf/openproject
OpenWhispr (Wispr Flow): OpenWhispr/openwhispr
VoiceStudio (ElevenLabs): debpalash/VoiceStudio
OpenSEO (Semrush): every-app/open-seo
open-higgsfield (Higgsfield): wide-trace/open-higgsfield
WeKnora (RAG / reads Notion): Tencent/WeKnora
Cal.diy (Calendly, MIT self-host): calcom/cal.diy
Which of the five would you self-host?
Independent channel. Not sponsored. Retold in our own words and visuals.
#AI #OpenSource #SelfHosted #shorts
Made with AI-generated visuals and voice.
31 views
9 open source Alternatives: Free Code Is Not Free Everything #shorts
Nine open-source alternatives, with the catches that subscription-replacement videos often skip: API usage, hosting, hardware and commercial license terms. This is a source-checked overview, not a claim that every tool is installed or that you will save a fixed amount.
Original pixel-art Wyatt animation, original script and locally generated transition sounds. AI-generated Kore narration. No reference footage, sprite, creator likeness, music or cloned voice used. YouTube altered/synthetic-content disclosure: Yes.
Checked27October2026. Project terms may change. Local models and third-party dependencies can have their own licenses. Cal.diy is currently marked for personal, non-production use. OpenSEO's real DataForSEO data is paid usage after limited trial credit. OpenHiggsfield requires a platform key; it is not verified unlimited free generation. Cap's distributed desktop app pricing charges for commercial rights; this is distinct from its source-code license. No affiliation or endorsement.
SOURCES
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
VoiceStudio terms/editions: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Community Edition: openproject.org
Chatwoot: chatwoot/chatwoot
Cal community repo: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: CapSoftware/Cap
Cap pricing: cap.so
[de-DE] 9 Open-Source-Alternativen: Freier Code ist nicht kostenlos #shorts
Neun Open-Source-Alternativen, die die Haken aufzeigen, die Videos zu Abo-Alternativen oft auslassen: API-Nutzung, Hosting, Hardware und kommerzielle Lizenzbedingungen. Dies ist eine geprüfte Übersicht, keine Garantie für die Installation aller Tools oder eine feste Ersparnis.
Originale Pixel-Art-Animation von Wyatt, Originalskript und lokal generierte Übergangssounds. KI-generierte Kore-Erzählung. Es wurden keine Referenzaufnahmen, Sprites, Abbildungen der Urheber, Musik oder geklonte Stimmen verwendet. Offenlegung veränderter/synthetischer Inhalte von YouTube: Ja.
Geprüft am 27. Oktober 2026. Die Projektbedingungen können sich ändern. Lokale Modelle und Abhängigkeiten von Drittanbietern können eigene Lizenzen haben. Cal.diy ist derzeit für den privaten, nicht-kommerziellen Gebrauch gekennzeichnet. Die echten DataForSEO-Daten von OpenSEO sind nach einer begrenzten Testphase kostenpflichtig. OpenHiggsfield benötigt einen Plattformschlüssel; die unbegrenzte kostenlose Generierung ist nicht garantiert. Die Preise für die Desktop-App von Cap beinhalten die kommerziellen Nutzungsrechte; diese sind von der Quellcode-Lizenz zu unterscheiden. Keine Verbindung oder Empfehlung.
QUELLEN
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
VoiceStudio Nutzungsbedingungen/Editionen: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Community Edition: openproject.org
Chatwoot: chatwoot/chatwoot
Cal Community-Repository: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: CapSoftware/Cap Preisinformationen: cap.so
[es-US] 9 alternativas de código abierto: Código gratis no significa gratis para todo #shorts
Nueve alternativas de código abierto, con los detalles que suelen omitir los vídeos que reemplazan las suscripciones: uso de la API, alojamiento, hardware y términos de la licencia comercial. Esta es una descripción general verificada, no una garantía de que todas las herramientas estén instaladas ni de que se obtenga un ahorro fijo.
Animación original de Wyatt en pixel art, guion original y sonidos de transición generados localmente. Narración de Kore generada por IA. No se utilizaron imágenes de referencia, sprites, imágenes del creador, música ni voces clonadas. Aviso de YouTube sobre contenido alterado/sintético: Sí.
Verificado el 27 de octubre de 2026. Los términos del proyecto pueden cambiar. Los modelos locales y las dependencias de terceros pueden tener sus propias licencias. Cal.diy está marcado actualmente para uso personal, no comercial. Los datos reales de DataForSEO de OpenSEO son de pago tras un período de prueba limitado. OpenHiggsfield requiere una clave de plataforma; no se garantiza la generación gratuita ilimitada. El precio de la aplicación de escritorio distribuida de Cap cobra por los derechos comerciales; esto es independiente de su licencia de código fuente. Sin afiliación ni respaldo.
FUENTES
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
Términos y condiciones de VoiceStudio: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Edición Comunitaria: openproject.org
Chatwoot: chatwoot/chatwoot
Repositorio comunitario de Cal: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: CapSoftware/Cap
Precios de Cap: cap.so
[fr-FR] 9 alternatives open source : le code gratuit n'est pas gratuit partout #shorts
Neuf alternatives open source, avec les points importants souvent omis dans les vidéos de remplacement d'abonnements : utilisation de l'API, hébergement, matériel et conditions de licence commerciale. Il s'agit d'un aperçu vérifié du code source, et non d'une garantie d'installation de tous les outils ou d'économies fixes.
Animation originale en pixel art de Wyatt, script original et sons de transition générés localement. Narration Kore générée par IA. Aucune image de référence, aucun sprite, aucune image du créateur, aucune musique ni voix clonée n'ont été utilisés. Divulgation du contenu modifié/synthétique sur YouTube : Oui.
Vérifié le 27 octobre 2026. Les conditions du projet peuvent changer. Les modèles locaux et les dépendances tierces peuvent avoir leurs propres licences. Cal.diy est actuellement indiqué pour un usage personnel et non commercial. L'utilisation des données réelles DataForSEO d'OpenSEO est payante après une période d'essai limitée. OpenHiggsfield nécessite une clé de plateforme ; la génération gratuite illimitée n'est pas vérifiée. L'application de bureau distribuée de Cap facture les droits commerciaux ; cela est distinct de sa licence de code source. Aucune affiliation ni approbation.
SOURCES
OpenWhispr : openwhispr/openwhispr
VoiceStudio : debpalash/VoiceStudio
Conditions d’utilisation et éditions de VoiceStudio : voicestudio.sh
WeKnora : Tencent/WeKnora
OpenProject : opf/openproject
Édition communautaire : openproject.org
Chatwoot : chatwoot/chatwoot
Dépôt communautaire de Cal : calcom/cal.com
OpenHiggsfield : wide-trace/open-higgsfield
OpenSEO : every-app/open-seo
DataForSEO : dataforseo.com
Cap : CapSoftware/Cap Tarifs : cap.so
[hi] 9 ओपन सोर्स विकल्प: फ्री कोड का मतलब सब कुछ मुफ्त नहीं #shorts
नौ ओपन-सोर्स विकल्प, जिनमें वे सभी शर्तें शामिल हैं जिन्हें अक्सर सब्सक्रिप्शन-रिप्लेसमेंट वीडियो अनदेखा कर देते हैं: API उपयोग, होस्टिंग, हार्डवेयर और वाणिज्यिक लाइसेंस की शर्तें। यह स्रोत-जांच पर आधारित एक विस्तृत अवलोकन है, यह दावा नहीं है कि हर टूल इंस्टॉल किया गया है या आप एक निश्चित राशि बचा लेंगे।
मूल पिक्सेल-आर्ट वायट एनिमेशन, मूल स्क्रिप्ट और स्थानीय रूप से उत्पन्न ट्रांज़िशन साउंड। AI-जनरेटेड कोर नैरेटर। कोई संदर्भ फुटेज, स्प्राइट, निर्माता की छवि, संगीत या क्लोन की गई आवाज का उपयोग नहीं किया गया है। YouTube द्वारा परिवर्तित/सिंथेटिक सामग्री का खुलासा: हाँ।
27 अक्टूबर 2026 को जांचा गया। प्रोजेक्ट की शर्तें बदल सकती हैं। स्थानीय मॉडल और तृतीय-पक्ष निर्भरताओं के अपने लाइसेंस हो सकते हैं। Cal.diy वर्तमान में व्यक्तिगत, गैर-उत्पादन उपयोग के लिए चिह्नित है। OpenSEO का वास्तविक DataForSEO डेटा सीमित परीक्षण क्रेडिट के बाद सशुल्क उपयोग के लिए उपलब्ध है। OpenHiggsfield के लिए एक प्लेटफ़ॉर्म कुंजी की आवश्यकता होती है; यह असीमित निःशुल्क उत्पादन के लिए सत्यापित नहीं है। Cap के वितरित डेस्कटॉप ऐप मूल्य निर्धारण में वाणिज्यिक अधिकारों के लिए शुल्क लिया जाता है; यह इसके स्रोत-कोड लाइसेंस से अलग है। कोई संबद्धता या समर्थन नहीं।
स्रोत
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
VoiceStudio नियम और शर्तें/संस्करण: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
कम्युनिटी एडिशन: openproject.org
Chatwoot: chatwoot/chatwoot
Cal कम्युनिटी रेपो: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
कैप: CapSoftware/Cap
कैप प्राइसिंग: cap.so
[id] 9 Alternatif Open Source: Kode Gratis Tidak Berarti Gratis Segalanya #shorts
Sembilan alternatif sumber terbuka, dengan catatan yang sering diabaikan oleh video pengganti berlangganan: penggunaan API, hosting, perangkat keras, dan ketentuan lisensi komersial. Ini adalah tinjauan yang telah diperiksa sumbernya, bukan klaim bahwa setiap alat telah diinstal atau bahwa Anda akan menghemat sejumlah uang tertentu.
Animasi Wyatt pixel-art asli, skrip asli, dan suara transisi yang dihasilkan secara lokal. Narasi Kore yang dihasilkan AI. Tidak ada cuplikan referensi, sprite, kemiripan kreator, musik, atau suara kloning yang digunakan. Pengungkapan konten yang diubah/sintetis YouTube: Ya.
Diperiksa 27 Oktober 2026. Ketentuan proyek dapat berubah. Model lokal dan dependensi pihak ketiga dapat memiliki lisensi sendiri. Cal.diy saat ini ditandai untuk penggunaan pribadi, bukan produksi. Data DataForSEO asli dari OpenSEO berbayar setelah kredit uji coba terbatas. OpenHiggsfield memerlukan kunci platform; ini tidak diverifikasi sebagai generasi gratis tanpa batas. Harga aplikasi desktop terdistribusi Cap mengenakan biaya untuk hak komersial; ini berbeda dari lisensi kode sumbernya. Tidak ada afiliasi atau dukungan.
SUMBER
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
Ketentuan/Edisi VoiceStudio: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Edisi Komunitas: openproject.org
Chatwoot: chatwoot/chatwoot
Repositori komunitas Cal: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: CapSoftware/Cap
Harga Cap: cap.so
[it] 9 alternative open source: il codice libero non è gratuito in tutto #shorts
Nove alternative open-source, con tutti i dettagli che i video che promettono di sostituire gli abbonamenti spesso omettono: utilizzo delle API, hosting, hardware e termini di licenza commerciale. Questa è una panoramica verificata a partire dalle fonti, non una garanzia che ogni strumento sia installato o che si possa risparmiare una somma fissa.
Animazione originale in pixel art di Wyatt, sceneggiatura originale e suoni di transizione generati localmente. Narrazione di Kore generata dall'IA. Nessun filmato di riferimento, sprite, immagine del creatore, musica o voce clonata utilizzati. Dichiarazione di YouTube sui contenuti modificati/sintetici: Sì.
Verificato il 27 ottobre 2026. I termini del progetto potrebbero subire variazioni. Modelli locali e dipendenze di terze parti possono avere licenze proprie. Cal.diy è attualmente contrassegnato per uso personale e non produttivo. I dati reali di DataForSEO di OpenSEO sono a pagamento dopo un periodo di prova limitato. OpenHiggsfield richiede una chiave di piattaforma; non è verificata la generazione gratuita illimitata. Il prezzo dell'app desktop distribuita di Cap prevede l'utilizzo dei diritti commerciali; questo è distinto dalla licenza del codice sorgente. Nessuna affiliazione o approvazione.
FONTI
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
Termini/edizioni di VoiceStudio: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Community Edition: openproject.org
Chatwoot: chatwoot/chatwoot
Repository della community di Cal: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: Italiano: CapSoftware/Cap
Prezzi di Cap: cap.so
[pt-BR] 9 Alternativas de código aberto: código gratuito não é tudo de graça #shorts
Nove alternativas de código aberto, com as ressalvas que os vídeos de substituição de assinaturas geralmente omitem: uso de API, hospedagem, hardware e termos de licença comercial. Esta é uma visão geral verificada a partir do código-fonte, não uma afirmação de que todas as ferramentas estão instaladas ou que você economizará uma quantia fixa.
Animação original em pixel art de Wyatt, roteiro original e sons de transição gerados localmente. Narração de Kore gerada por IA. Nenhuma filmagem de referência, sprite, imagem do criador, música ou voz clonada foi usada. Divulgação de conteúdo alterado/sintético do YouTube: Sim.
Verificado em 27 de outubro de 2026. Os termos do projeto podem mudar. Modelos locais e dependências de terceiros podem ter suas próprias licenças. O Cal.diy está atualmente marcado para uso pessoal, não comercial. Os dados reais do DataForSEO do OpenSEO são de uso pago após um período de teste limitado. O OpenHiggsfield requer uma chave de plataforma; não há verificação de geração gratuita ilimitada. O preço do aplicativo de desktop distribuído do Cap cobra por direitos comerciais; isso é distinto de sua licença de código-fonte. Sem afiliação ou endosso.
FONTES
OpenWhispr: openwhispr/openwhispr
VoiceStudio: debpalash/VoiceStudio
Termos/edições do VoiceStudio: voicestudio.sh
WeKnora: Tencent/WeKnora
OpenProject: opf/openproject
Community Edition: openproject.org
Chatwoot: chatwoot/chatwoot
Repositório da comunidade Cal: calcom/cal.com
OpenHiggsfield: wide-trace/open-higgsfield
OpenSEO: every-app/open-seo
DataForSEO: dataforseo.com
Cap: CapSoftware/Cap
Cap Preços: cap.so
1 like · 30 views
Six routes to a team knowledge base | 6 open-source choices
Knowledge bases need more than chatbots. Six options, with different use cases and adoption checks.
RAGFlow, AnythingLLM, Haystack, MaxKB, WeKnora, Onyx.
Explore the original cards: channel profile → AI Open Source Radar → Collections. Choose the collection for this task and inspect the project cards.
useaistation.com
Sources checked 23 Oct 2026. This is a project-selection guide, not hands-on testing or a live ranking. These are different choices, not a verified integrated stack. Software licenses, model weights, hardware and external service costs must be checked separately. Community/core and enterprise features may differ.
Developer disclosure: we build AI Open Source Radar, not the featured projects. Narration: Microsoft free Aria neural voice.
Project and License sources (observed branch references, subject to change):
RAGFlow: infiniflow/ragflow
License: raw.githubusercontent.com
AnythingLLM: Mintplex-Labs/anything-llm
License: raw.githubusercontent.com
Haystack: deepset-ai/haystack
License: raw.githubusercontent.com
MaxKB: 1Panel-dev/MaxKB
License: raw.githubusercontent.com
WeKnora: Tencent/WeKnora
License: raw.githubusercontent.com
Onyx: onyx-dot-app/onyx
License: raw.githubusercontent.com
#OpenSource #AITools #RAG
16 views
I noticed in WeKnora#4708 that GraalVM remains the only option for compiling Python into a native artifact. 🐆 In contrast, for TypeScript, there are at least three AOT compilation options: oracle/graaljs, vercel-labs/scriptc, and oven-sh/bun .
1 like · 25 views
Tencent/WeKnora's agent blew past the context limit on final-answer synthesis with no recovery, and swallowed max-iteration errors. Now oversized synthesis is refused and errors propagate. 234/234 tests green. WeKnora#4629 #OpenSource #Go
1 like · 29 views
Keeping Vector Retrieval Stable While Your Knowledge Base Is Still Loading
Keeping Vector Retrieval Stable While Your Knowledge Base Is Still Loading
At 3:17 AM, your agent platform stops responding. Ingestion workers are retrying document chunks. Retrieval latency has spiked from 80ms to 4 seconds. The HNSW index is fine. The problem is that ingestion and retrieval are fighting over the same PostgreSQL pages, and neither path has backpressure logic. This is the production failure that tutorials skip.
I am evaluating Tencent/WeKnora as an external integrator, using its stated document-to-RAG, agent, and self-maintaining Wiki scope. The design below is a proposed PostgreSQL retrieval boundary, not a claim about WeKnora's current implementation or measured performance.
Keep ingestion outside the answering path
Separate document parsing, chunking, and embedding into asynchronous workers. Those workers write versioned chunks into PostgreSQL. Retrieval reads only published document versions; generation receives retrieved text and provenance, never responsibility for repairing ingestion.
For agent memory, use the same boundary: proposed memories enter ingestion rather than becoming searchable immediately. Otherwise, an agent can retrieve its own unvalidated output and reinforce it.
My proposed generation benchmark topology places an optional relay at https://b-lost.com/v1, B-Lost's gateway endpoint. It remains outside embedding generation and database timing. Availability, authentication, and model compatibility must be verified before running that baseline; no relay measurements are claimed here.
That separation matters: changing an embedding model requires a new embedding space and reindexing, whereas changing a generation endpoint should not.
The failure that tutorials miss
Consider a production incident reconstruction, not a reported WeKnora outage: concurrent ingestion workers begin inserting into an already large HNSW index. Insert latency rises, workers retry, and retrieval tail latency follows.
HNSW updates can contend on internal index-page locks, but "the index is locked" is not a sufficient diagnosis. Correlate PostgreSQL wait events (pg_stat_activity.wait_event_type, wait_event) with ingestion concurrency, WAL volume, buffer pressure (shared_buffers exhaustion), and query plans. Storage saturation (IOPS ceiling, write queue depth) and unrelated transaction locks can produce similar symptoms. Check pg_stat_statements for insert durations and pg_locks for blocking queries.
The immediate response is bounded ingestion concurrency (semaphore or worker pool size), bounded batches (500-1000 rows per transaction, not 50,000), and exponential retry backoff with jitter, not more workers. For an initial bulk import, loading before building HNSW often reduces write amplification. An existing serving table needs a separately scheduled CREATE INDEX CONCURRENTLY to avoid blocking reads.
A second failure often appears as "bad vectors." With inner-product ranking, inconsistent embedding normalization lets vector magnitude distort relevance. With cosine distance, ordinary positive rescaling does not change ranking. Check model revisions (OpenAI text-embedding-3-small vs ada-002), truncation (padding vs truncating to 768 dimensions), zero vectors (NaN propagation from malformed input), and filters before blaming normalization. Validate that ingestion and retrieval use identical preprocessing.
One runnable retrieval boundary
This example requires Python 3, psycopg[binary], PostgreSQL, and pgvector 0.8 or newer. Save it as retrieve.py. Run python retrieve.py init once, then python retrieve.py query tenant-uuid embedding.json search words. The JSON file must contain a 768-number array from the same embedding model used during ingestion.
import json
import math
import os
import sys
import psycopg
from psycopg.rows import dict_row
DSN = os.environ["DATABASE_URL"]
SCHEMA = """
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS memory_chunk (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
tenant_id uuid NOT NULL,
content text NOT NULL,
embedding vector(768) NOT NULL,
search_document tsvector GENERATED ALWAYS AS
(to_tsvector('english', content)) STORED
);
CREATE INDEX IF NOT EXISTS memory_tenant
ON memory_chunk (tenant_id);
CREATE INDEX IF NOT EXISTS memory_embedding_hnsw
ON memory_chunk USING hnsw (embedding vector_cosine_ops)
WITH (m = 16, ef_construction = 128);
CREATE INDEX IF NOT EXISTS memory_search
ON memory_chunk USING gin (search_document);
"""
def normalize(values):
values = [float(x) for x in values]
if len(values) != 768 or not all(map(math.isfinite, values)):
raise ValueError("Expected 768 finite values")
norm = math.sqrt(sum(x * x for x in values))
if norm == 0:
raise ValueError("Zero embedding")
return [x / norm for x in values]
def rrf(rankings, k=60, limit=10):
if k < 1:
raise ValueError("k must be positive")
scores, documents = {}, {}
for ranking in rankings:
seen = set()
for rank, row in enumerate(ranking, start=1):
key = row["id"]
if key in seen:
continue
seen.add(key)
documents[key] = row
scores[key] = scores.get(key, 0.0) + 1.0 / (k + rank)
ordered = sorted(scores, key=lambda key: (-scores[key], key))
return [
{**documents[key], "rrf_score": scores[key]}
for key in ordered[:limit]
]
with psycopg.connect(DSN, row_factory=dict_row) as conn:
if sys.argv[1] == "init":
conn.execute(SCHEMA)
else:
tenant = sys.argv[2]
with open(sys.argv[3]) as source:
vector = json.dumps(normalize(json.load(source)))
text = " ".join(sys.argv[4:])
conn.execute("SET LOCAL hnsw.ef_search = 100")
conn.execute("SET LOCAL hnsw.iterative_scan = strict_order")
conn.execute("SET LOCAL hnsw.max_scan_tuples = 20000")
dense = conn.execute("""
SELECT id, content
FROM memory_chunk
WHERE tenant_id = %s::uuid
ORDER BY embedding <=> %s::vector
LIMIT 50
""", (tenant, vector)).fetchall()
lexical = conn.execute("""
SELECT id, content
FROM memory_chunk,
websearch_to_tsquery('english', %s) AS q
WHERE tenant_id = %s::uuid AND search_document @@ q
ORDER BY ts_rank_cd(search_document, q) DESC, id
LIMIT 50
""", (text, tenant)).fetchall()
print(json.dumps(rrf([dense, lexical]), indent=2))
Apply the same validation and normalization during ingestion. Treat this schema as the retrieval kernel; document versions and publication state belong in the surrounding ingestion contract. Run initialization separately from serving traffic. Add connection pooling (pgbouncer in transaction mode, or application-level pools with pool_size=20, max_overflow=10) to prevent connection exhaustion under load.
Spend latency where recall needs it
Filtered approximate search is the central trade-off. HNSW may encounter many neighboring vectors belonging to other tenants before finding enough eligible rows. Iterative scanning (hnsw.iterative_scan = strict_order) helps, but its scan budget (hnsw.max_scan_tuples) is finite. For small tenant datasets (under 10,000 rows), an exact distance sort over tenant-filtered rows may be faster and more complete than approximate search with high filtering overhead.
RRF combines lexical and semantic ranks without pretending their raw scores share a scale. It rescues identifiers and exact phrases that embeddings sometimes miss, but cannot recover candidates absent from both lists. Test retrieval quality by measuring recall@10 against a labeled eval set, not by eyeballing results.
Finally, tenant predicates are not authorization. Derive tenant identity from authenticated context (JWT claims, session middleware) and enforce database isolation where appropriate (row-level security policies if tenants must share tables). Compare approximate results against exact tenant-filtered search while ingestion runs. That comparison distinguishes a fast query from a retrieval system an agent can trust.
What's the hardest choice you've made?
The question that keeps me up is this: when do you stop treating ingestion as best-effort background work and start throttling user-facing features to preserve database stability? I've seen teams add circuit breakers that pause document uploads when retrieval p99 crosses 500ms, and I've seen teams accept 2-second retrieval during bulk imports because agents can wait. Both choices are defensible. Both have failed under unexpected load.
What's your architecture? Have you hit the wall where approximate search stopped being approximate enough, or where exact search became too slow? What did you change, and what did you wish you'd known six months earlier?
🔗 Tencent/WeKnora
weknora.weixin.qq.com
腾讯微信开源知识库 weknora 的官网
Tencent/WeKnora
weknora GitHub 上的库
1 like · 11 views
Mentions
Fixed WeKnora's /api/ responses hanging in Chrome 154 — a one-line nginx fix restoring chunked transfer encoding, proven on a live proxy test. WeKnora#4949 #OpenSource #WebDev #nginx
50×3=150 个数据库连接名额。 知识库平台 WeKnora 今天主分支加了连接池上限,限制每个实例的连接数。 你照抄示例的 50,三台服务就可能挤爆只有 100 个名额的数据库。连接预算得按副本分,给运维也留几个。 #Agent工程 github.com/Tencent/WeKnora/commit/4cfb929df6f209f…
9 'Free' AI & Dev Repos: Only 5 Are Actually Free A viral reel lists nine 'free' GitHub repos that replace paid software and implies you'll save hundreds a month. All nine are real, but 'free' needs an asterisk, so here's the honest sort (stars and prices at time of filming). Genuinely free and self-hosted: Cap (replaces Loom), Chatwoot (Intercom), OpenProject (Asana, Community Edition), OpenWhispr (Wispr Flow), and VoiceStudio (ElevenLabs-style voice cloning that runs locally). Download, run, done. Free app, but you still pay someone: OpenSEO replaces the Semrush subscription but needs a paid DataForSEO API key (pay-as-you-go, $50 minimum top-up), so you pay per lookup; and open-higgsfield is a free UI that calls Higgsfield's own API and spends credits on your paid Higgsfield account. Read the licence first: the fully-free Calendly self-host is the Cal.diy fork, whose README says personal, non-production use only (commercial Cal.com is open-core); and WeKnora is a local document-Q&A (RAG) tool that can read your Notion, not a Notion-workspace replacement. And every one means you run the server, updates, backups and security yourself. The reel's on-screen savings total only counts five of the nine tools and doesn't even add up, so treat savings as 'could', not 'will'. Still, five solid freebies is a genuinely good haul. Sources (checked 22 Oct 2026): Cap (replaces Loom): CapSoftware/Cap Chatwoot (Intercom): chatwoot/chatwoot OpenProject (Asana): opf/openproject OpenWhispr (Wispr Flow): OpenWhispr/openwhispr VoiceStudio (ElevenLabs): debpalash/VoiceStudio OpenSEO (Semrush): every-app/open-seo open-higgsfield (Higgsfield): wide-trace/open-higgsfield WeKnora (RAG / reads Notion): Tencent/WeKnora Cal.diy (Calendly, MIT self-host): calcom/cal.diy Which of the five would you self-host? Independent channel. Not sponsored. Retold in our own words and visuals. #AI #OpenSource #SelfHosted #shorts Made with AI-generated visuals and voice.
9 open source Alternatives: Free Code Is Not Free Everything #shorts Nine open-source alternatives, with the catches that subscription-replacement videos often skip: API usage, hosting, hardware and commercial license terms. This is a source-checked overview, not a claim that every tool is installed or that you will save a fixed amount. Original pixel-art Wyatt animation, original script and locally generated transition sounds. AI-generated Kore narration. No reference footage, sprite, creator likeness, music or cloned voice used. YouTube altered/synthetic-content disclosure: Yes. Checked27October2026. Project terms may change. Local models and third-party dependencies can have their own licenses. Cal.diy is currently marked for personal, non-production use. OpenSEO's real DataForSEO data is paid usage after limited trial credit. OpenHiggsfield requires a platform key; it is not verified unlimited free generation. Cap's distributed desktop app pricing charges for commercial rights; this is distinct from its source-code license. No affiliation or endorsement. SOURCES OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio VoiceStudio terms/editions: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Community Edition: openproject.org Chatwoot: chatwoot/chatwoot Cal community repo: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: CapSoftware/Cap Cap pricing: cap.so [de-DE] 9 Open-Source-Alternativen: Freier Code ist nicht kostenlos #shorts Neun Open-Source-Alternativen, die die Haken aufzeigen, die Videos zu Abo-Alternativen oft auslassen: API-Nutzung, Hosting, Hardware und kommerzielle Lizenzbedingungen. Dies ist eine geprüfte Übersicht, keine Garantie für die Installation aller Tools oder eine feste Ersparnis. Originale Pixel-Art-Animation von Wyatt, Originalskript und lokal generierte Übergangssounds. KI-generierte Kore-Erzählung. Es wurden keine Referenzaufnahmen, Sprites, Abbildungen der Urheber, Musik oder geklonte Stimmen verwendet. Offenlegung veränderter/synthetischer Inhalte von YouTube: Ja. Geprüft am 27. Oktober 2026. Die Projektbedingungen können sich ändern. Lokale Modelle und Abhängigkeiten von Drittanbietern können eigene Lizenzen haben. Cal.diy ist derzeit für den privaten, nicht-kommerziellen Gebrauch gekennzeichnet. Die echten DataForSEO-Daten von OpenSEO sind nach einer begrenzten Testphase kostenpflichtig. OpenHiggsfield benötigt einen Plattformschlüssel; die unbegrenzte kostenlose Generierung ist nicht garantiert. Die Preise für die Desktop-App von Cap beinhalten die kommerziellen Nutzungsrechte; diese sind von der Quellcode-Lizenz zu unterscheiden. Keine Verbindung oder Empfehlung. QUELLEN OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio VoiceStudio Nutzungsbedingungen/Editionen: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Community Edition: openproject.org Chatwoot: chatwoot/chatwoot Cal Community-Repository: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: CapSoftware/Cap Preisinformationen: cap.so [es-US] 9 alternativas de código abierto: Código gratis no significa gratis para todo #shorts Nueve alternativas de código abierto, con los detalles que suelen omitir los vídeos que reemplazan las suscripciones: uso de la API, alojamiento, hardware y términos de la licencia comercial. Esta es una descripción general verificada, no una garantía de que todas las herramientas estén instaladas ni de que se obtenga un ahorro fijo. Animación original de Wyatt en pixel art, guion original y sonidos de transición generados localmente. Narración de Kore generada por IA. No se utilizaron imágenes de referencia, sprites, imágenes del creador, música ni voces clonadas. Aviso de YouTube sobre contenido alterado/sintético: Sí. Verificado el 27 de octubre de 2026. Los términos del proyecto pueden cambiar. Los modelos locales y las dependencias de terceros pueden tener sus propias licencias. Cal.diy está marcado actualmente para uso personal, no comercial. Los datos reales de DataForSEO de OpenSEO son de pago tras un período de prueba limitado. OpenHiggsfield requiere una clave de plataforma; no se garantiza la generación gratuita ilimitada. El precio de la aplicación de escritorio distribuida de Cap cobra por los derechos comerciales; esto es independiente de su licencia de código fuente. Sin afiliación ni respaldo. FUENTES OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio Términos y condiciones de VoiceStudio: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Edición Comunitaria: openproject.org Chatwoot: chatwoot/chatwoot Repositorio comunitario de Cal: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: CapSoftware/Cap Precios de Cap: cap.so [fr-FR] 9 alternatives open source : le code gratuit n'est pas gratuit partout #shorts Neuf alternatives open source, avec les points importants souvent omis dans les vidéos de remplacement d'abonnements : utilisation de l'API, hébergement, matériel et conditions de licence commerciale. Il s'agit d'un aperçu vérifié du code source, et non d'une garantie d'installation de tous les outils ou d'économies fixes. Animation originale en pixel art de Wyatt, script original et sons de transition générés localement. Narration Kore générée par IA. Aucune image de référence, aucun sprite, aucune image du créateur, aucune musique ni voix clonée n'ont été utilisés. Divulgation du contenu modifié/synthétique sur YouTube : Oui. Vérifié le 27 octobre 2026. Les conditions du projet peuvent changer. Les modèles locaux et les dépendances tierces peuvent avoir leurs propres licences. Cal.diy est actuellement indiqué pour un usage personnel et non commercial. L'utilisation des données réelles DataForSEO d'OpenSEO est payante après une période d'essai limitée. OpenHiggsfield nécessite une clé de plateforme ; la génération gratuite illimitée n'est pas vérifiée. L'application de bureau distribuée de Cap facture les droits commerciaux ; cela est distinct de sa licence de code source. Aucune affiliation ni approbation. SOURCES OpenWhispr : openwhispr/openwhispr VoiceStudio : debpalash/VoiceStudio Conditions d’utilisation et éditions de VoiceStudio : voicestudio.sh WeKnora : Tencent/WeKnora OpenProject : opf/openproject Édition communautaire : openproject.org Chatwoot : chatwoot/chatwoot Dépôt communautaire de Cal : calcom/cal.com OpenHiggsfield : wide-trace/open-higgsfield OpenSEO : every-app/open-seo DataForSEO : dataforseo.com Cap : CapSoftware/Cap Tarifs : cap.so [hi] 9 ओपन सोर्स विकल्प: फ्री कोड का मतलब सब कुछ मुफ्त नहीं #shorts नौ ओपन-सोर्स विकल्प, जिनमें वे सभी शर्तें शामिल हैं जिन्हें अक्सर सब्सक्रिप्शन-रिप्लेसमेंट वीडियो अनदेखा कर देते हैं: API उपयोग, होस्टिंग, हार्डवेयर और वाणिज्यिक लाइसेंस की शर्तें। यह स्रोत-जांच पर आधारित एक विस्तृत अवलोकन है, यह दावा नहीं है कि हर टूल इंस्टॉल किया गया है या आप एक निश्चित राशि बचा लेंगे। मूल पिक्सेल-आर्ट वायट एनिमेशन, मूल स्क्रिप्ट और स्थानीय रूप से उत्पन्न ट्रांज़िशन साउंड। AI-जनरेटेड कोर नैरेटर। कोई संदर्भ फुटेज, स्प्राइट, निर्माता की छवि, संगीत या क्लोन की गई आवाज का उपयोग नहीं किया गया है। YouTube द्वारा परिवर्तित/सिंथेटिक सामग्री का खुलासा: हाँ। 27 अक्टूबर 2026 को जांचा गया। प्रोजेक्ट की शर्तें बदल सकती हैं। स्थानीय मॉडल और तृतीय-पक्ष निर्भरताओं के अपने लाइसेंस हो सकते हैं। Cal.diy वर्तमान में व्यक्तिगत, गैर-उत्पादन उपयोग के लिए चिह्नित है। OpenSEO का वास्तविक DataForSEO डेटा सीमित परीक्षण क्रेडिट के बाद सशुल्क उपयोग के लिए उपलब्ध है। OpenHiggsfield के लिए एक प्लेटफ़ॉर्म कुंजी की आवश्यकता होती है; यह असीमित निःशुल्क उत्पादन के लिए सत्यापित नहीं है। Cap के वितरित डेस्कटॉप ऐप मूल्य निर्धारण में वाणिज्यिक अधिकारों के लिए शुल्क लिया जाता है; यह इसके स्रोत-कोड लाइसेंस से अलग है। कोई संबद्धता या समर्थन नहीं। स्रोत OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio VoiceStudio नियम और शर्तें/संस्करण: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject कम्युनिटी एडिशन: openproject.org Chatwoot: chatwoot/chatwoot Cal कम्युनिटी रेपो: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com कैप: CapSoftware/Cap कैप प्राइसिंग: cap.so [id] 9 Alternatif Open Source: Kode Gratis Tidak Berarti Gratis Segalanya #shorts Sembilan alternatif sumber terbuka, dengan catatan yang sering diabaikan oleh video pengganti berlangganan: penggunaan API, hosting, perangkat keras, dan ketentuan lisensi komersial. Ini adalah tinjauan yang telah diperiksa sumbernya, bukan klaim bahwa setiap alat telah diinstal atau bahwa Anda akan menghemat sejumlah uang tertentu. Animasi Wyatt pixel-art asli, skrip asli, dan suara transisi yang dihasilkan secara lokal. Narasi Kore yang dihasilkan AI. Tidak ada cuplikan referensi, sprite, kemiripan kreator, musik, atau suara kloning yang digunakan. Pengungkapan konten yang diubah/sintetis YouTube: Ya. Diperiksa 27 Oktober 2026. Ketentuan proyek dapat berubah. Model lokal dan dependensi pihak ketiga dapat memiliki lisensi sendiri. Cal.diy saat ini ditandai untuk penggunaan pribadi, bukan produksi. Data DataForSEO asli dari OpenSEO berbayar setelah kredit uji coba terbatas. OpenHiggsfield memerlukan kunci platform; ini tidak diverifikasi sebagai generasi gratis tanpa batas. Harga aplikasi desktop terdistribusi Cap mengenakan biaya untuk hak komersial; ini berbeda dari lisensi kode sumbernya. Tidak ada afiliasi atau dukungan. SUMBER OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio Ketentuan/Edisi VoiceStudio: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Edisi Komunitas: openproject.org Chatwoot: chatwoot/chatwoot Repositori komunitas Cal: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: CapSoftware/Cap Harga Cap: cap.so [it] 9 alternative open source: il codice libero non è gratuito in tutto #shorts Nove alternative open-source, con tutti i dettagli che i video che promettono di sostituire gli abbonamenti spesso omettono: utilizzo delle API, hosting, hardware e termini di licenza commerciale. Questa è una panoramica verificata a partire dalle fonti, non una garanzia che ogni strumento sia installato o che si possa risparmiare una somma fissa. Animazione originale in pixel art di Wyatt, sceneggiatura originale e suoni di transizione generati localmente. Narrazione di Kore generata dall'IA. Nessun filmato di riferimento, sprite, immagine del creatore, musica o voce clonata utilizzati. Dichiarazione di YouTube sui contenuti modificati/sintetici: Sì. Verificato il 27 ottobre 2026. I termini del progetto potrebbero subire variazioni. Modelli locali e dipendenze di terze parti possono avere licenze proprie. Cal.diy è attualmente contrassegnato per uso personale e non produttivo. I dati reali di DataForSEO di OpenSEO sono a pagamento dopo un periodo di prova limitato. OpenHiggsfield richiede una chiave di piattaforma; non è verificata la generazione gratuita illimitata. Il prezzo dell'app desktop distribuita di Cap prevede l'utilizzo dei diritti commerciali; questo è distinto dalla licenza del codice sorgente. Nessuna affiliazione o approvazione. FONTI OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio Termini/edizioni di VoiceStudio: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Community Edition: openproject.org Chatwoot: chatwoot/chatwoot Repository della community di Cal: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: Italiano: CapSoftware/Cap Prezzi di Cap: cap.so [pt-BR] 9 Alternativas de código aberto: código gratuito não é tudo de graça #shorts Nove alternativas de código aberto, com as ressalvas que os vídeos de substituição de assinaturas geralmente omitem: uso de API, hospedagem, hardware e termos de licença comercial. Esta é uma visão geral verificada a partir do código-fonte, não uma afirmação de que todas as ferramentas estão instaladas ou que você economizará uma quantia fixa. Animação original em pixel art de Wyatt, roteiro original e sons de transição gerados localmente. Narração de Kore gerada por IA. Nenhuma filmagem de referência, sprite, imagem do criador, música ou voz clonada foi usada. Divulgação de conteúdo alterado/sintético do YouTube: Sim. Verificado em 27 de outubro de 2026. Os termos do projeto podem mudar. Modelos locais e dependências de terceiros podem ter suas próprias licenças. O Cal.diy está atualmente marcado para uso pessoal, não comercial. Os dados reais do DataForSEO do OpenSEO são de uso pago após um período de teste limitado. O OpenHiggsfield requer uma chave de plataforma; não há verificação de geração gratuita ilimitada. O preço do aplicativo de desktop distribuído do Cap cobra por direitos comerciais; isso é distinto de sua licença de código-fonte. Sem afiliação ou endosso. FONTES OpenWhispr: openwhispr/openwhispr VoiceStudio: debpalash/VoiceStudio Termos/edições do VoiceStudio: voicestudio.sh WeKnora: Tencent/WeKnora OpenProject: opf/openproject Community Edition: openproject.org Chatwoot: chatwoot/chatwoot Repositório da comunidade Cal: calcom/cal.com OpenHiggsfield: wide-trace/open-higgsfield OpenSEO: every-app/open-seo DataForSEO: dataforseo.com Cap: CapSoftware/Cap Cap Preços: cap.so
Six routes to a team knowledge base | 6 open-source choices Knowledge bases need more than chatbots. Six options, with different use cases and adoption checks. RAGFlow, AnythingLLM, Haystack, MaxKB, WeKnora, Onyx. Explore the original cards: channel profile → AI Open Source Radar → Collections. Choose the collection for this task and inspect the project cards. useaistation.com Sources checked 23 Oct 2026. This is a project-selection guide, not hands-on testing or a live ranking. These are different choices, not a verified integrated stack. Software licenses, model weights, hardware and external service costs must be checked separately. Community/core and enterprise features may differ. Developer disclosure: we build AI Open Source Radar, not the featured projects. Narration: Microsoft free Aria neural voice. Project and License sources (observed branch references, subject to change): RAGFlow: infiniflow/ragflow License: raw.githubusercontent.com AnythingLLM: Mintplex-Labs/anything-llm License: raw.githubusercontent.com Haystack: deepset-ai/haystack License: raw.githubusercontent.com MaxKB: 1Panel-dev/MaxKB License: raw.githubusercontent.com WeKnora: Tencent/WeKnora License: raw.githubusercontent.com Onyx: onyx-dot-app/onyx License: raw.githubusercontent.com #OpenSource #AITools #RAG
I noticed in WeKnora#4708 that GraalVM remains the only option for compiling Python into a native artifact. 🐆 In contrast, for TypeScript, there are at least three AOT compilation options: oracle/graaljs, vercel-labs/scriptc, and oven-sh/bun .
Tencent/WeKnora's agent blew past the context limit on final-answer synthesis with no recovery, and swallowed max-iteration errors. Now oversized synthesis is refused and errors propagate. 234/234 tests green. WeKnora#4629 #OpenSource #Go
Keeping Vector Retrieval Stable While Your Knowledge Base Is Still Loading Keeping Vector Retrieval Stable While Your Knowledge Base Is Still Loading At 3:17 AM, your agent platform stops responding. Ingestion workers are retrying document chunks. Retrieval latency has spiked from 80ms to 4 seconds. The HNSW index is fine. The problem is that ingestion and retrieval are fighting over the same PostgreSQL pages, and neither path has backpressure logic. This is the production failure that tutorials skip. I am evaluating Tencent/WeKnora as an external integrator, using its stated document-to-RAG, agent, and self-maintaining Wiki scope. The design below is a proposed PostgreSQL retrieval boundary, not a claim about WeKnora's current implementation or measured performance. Keep ingestion outside the answering path Separate document parsing, chunking, and embedding into asynchronous workers. Those workers write versioned chunks into PostgreSQL. Retrieval reads only published document versions; generation receives retrieved text and provenance, never responsibility for repairing ingestion. For agent memory, use the same boundary: proposed memories enter ingestion rather than becoming searchable immediately. Otherwise, an agent can retrieve its own unvalidated output and reinforce it. My proposed generation benchmark topology places an optional relay at https://b-lost.com/v1, B-Lost's gateway endpoint. It remains outside embedding generation and database timing. Availability, authentication, and model compatibility must be verified before running that baseline; no relay measurements are claimed here. That separation matters: changing an embedding model requires a new embedding space and reindexing, whereas changing a generation endpoint should not. The failure that tutorials miss Consider a production incident reconstruction, not a reported WeKnora outage: concurrent ingestion workers begin inserting into an already large HNSW index. Insert latency rises, workers retry, and retrieval tail latency follows. HNSW updates can contend on internal index-page locks, but "the index is locked" is not a sufficient diagnosis. Correlate PostgreSQL wait events (pg_stat_activity.wait_event_type, wait_event) with ingestion concurrency, WAL volume, buffer pressure (shared_buffers exhaustion), and query plans. Storage saturation (IOPS ceiling, write queue depth) and unrelated transaction locks can produce similar symptoms. Check pg_stat_statements for insert durations and pg_locks for blocking queries. The immediate response is bounded ingestion concurrency (semaphore or worker pool size), bounded batches (500-1000 rows per transaction, not 50,000), and exponential retry backoff with jitter, not more workers. For an initial bulk import, loading before building HNSW often reduces write amplification. An existing serving table needs a separately scheduled CREATE INDEX CONCURRENTLY to avoid blocking reads. A second failure often appears as "bad vectors." With inner-product ranking, inconsistent embedding normalization lets vector magnitude distort relevance. With cosine distance, ordinary positive rescaling does not change ranking. Check model revisions (OpenAI text-embedding-3-small vs ada-002), truncation (padding vs truncating to 768 dimensions), zero vectors (NaN propagation from malformed input), and filters before blaming normalization. Validate that ingestion and retrieval use identical preprocessing. One runnable retrieval boundary This example requires Python 3, psycopg[binary], PostgreSQL, and pgvector 0.8 or newer. Save it as retrieve.py. Run python retrieve.py init once, then python retrieve.py query tenant-uuid embedding.json search words. The JSON file must contain a 768-number array from the same embedding model used during ingestion. import json import math import os import sys import psycopg from psycopg.rows import dict_row DSN = os.environ["DATABASE_URL"] SCHEMA = """ CREATE EXTENSION IF NOT EXISTS vector; CREATE TABLE IF NOT EXISTS memory_chunk ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, tenant_id uuid NOT NULL, content text NOT NULL, embedding vector(768) NOT NULL, search_document tsvector GENERATED ALWAYS AS (to_tsvector('english', content)) STORED ); CREATE INDEX IF NOT EXISTS memory_tenant ON memory_chunk (tenant_id); CREATE INDEX IF NOT EXISTS memory_embedding_hnsw ON memory_chunk USING hnsw (embedding vector_cosine_ops) WITH (m = 16, ef_construction = 128); CREATE INDEX IF NOT EXISTS memory_search ON memory_chunk USING gin (search_document); """ def normalize(values): values = [float(x) for x in values] if len(values) != 768 or not all(map(math.isfinite, values)): raise ValueError("Expected 768 finite values") norm = math.sqrt(sum(x * x for x in values)) if norm == 0: raise ValueError("Zero embedding") return [x / norm for x in values] def rrf(rankings, k=60, limit=10): if k < 1: raise ValueError("k must be positive") scores, documents = {}, {} for ranking in rankings: seen = set() for rank, row in enumerate(ranking, start=1): key = row["id"] if key in seen: continue seen.add(key) documents[key] = row scores[key] = scores.get(key, 0.0) + 1.0 / (k + rank) ordered = sorted(scores, key=lambda key: (-scores[key], key)) return [ {**documents[key], "rrf_score": scores[key]} for key in ordered[:limit] ] with psycopg.connect(DSN, row_factory=dict_row) as conn: if sys.argv[1] == "init": conn.execute(SCHEMA) else: tenant = sys.argv[2] with open(sys.argv[3]) as source: vector = json.dumps(normalize(json.load(source))) text = " ".join(sys.argv[4:]) conn.execute("SET LOCAL hnsw.ef_search = 100") conn.execute("SET LOCAL hnsw.iterative_scan = strict_order") conn.execute("SET LOCAL hnsw.max_scan_tuples = 20000") dense = conn.execute(""" SELECT id, content FROM memory_chunk WHERE tenant_id = %s::uuid ORDER BY embedding <=> %s::vector LIMIT 50 """, (tenant, vector)).fetchall() lexical = conn.execute(""" SELECT id, content FROM memory_chunk, websearch_to_tsquery('english', %s) AS q WHERE tenant_id = %s::uuid AND search_document @@ q ORDER BY ts_rank_cd(search_document, q) DESC, id LIMIT 50 """, (text, tenant)).fetchall() print(json.dumps(rrf([dense, lexical]), indent=2)) Apply the same validation and normalization during ingestion. Treat this schema as the retrieval kernel; document versions and publication state belong in the surrounding ingestion contract. Run initialization separately from serving traffic. Add connection pooling (pgbouncer in transaction mode, or application-level pools with pool_size=20, max_overflow=10) to prevent connection exhaustion under load. Spend latency where recall needs it Filtered approximate search is the central trade-off. HNSW may encounter many neighboring vectors belonging to other tenants before finding enough eligible rows. Iterative scanning (hnsw.iterative_scan = strict_order) helps, but its scan budget (hnsw.max_scan_tuples) is finite. For small tenant datasets (under 10,000 rows), an exact distance sort over tenant-filtered rows may be faster and more complete than approximate search with high filtering overhead. RRF combines lexical and semantic ranks without pretending their raw scores share a scale. It rescues identifiers and exact phrases that embeddings sometimes miss, but cannot recover candidates absent from both lists. Test retrieval quality by measuring recall@10 against a labeled eval set, not by eyeballing results. Finally, tenant predicates are not authorization. Derive tenant identity from authenticated context (JWT claims, session middleware) and enforce database isolation where appropriate (row-level security policies if tenants must share tables). Compare approximate results against exact tenant-filtered search while ingestion runs. That comparison distinguishes a fast query from a retrieval system an agent can trust. What's the hardest choice you've made? The question that keeps me up is this: when do you stop treating ingestion as best-effort background work and start throttling user-facing features to preserve database stability? I've seen teams add circuit breakers that pause document uploads when retrieval p99 crosses 500ms, and I've seen teams accept 2-second retrieval during bulk imports because agents can wait. Both choices are defensible. Both have failed under unexpected load. What's your architecture? Have you hit the wall where approximate search stopped being approximate enough, or where exact search became too slow? What did you change, and what did you wish you'd known six months earlier?
🔗 Tencent/WeKnora
weknora.weixin.qq.com 腾讯微信开源知识库 weknora 的官网 Tencent/WeKnora weknora GitHub 上的库