RAG at 10 Million Documents — System Design
submitted by /u/lucian-12 [link] [留言]
找到 1413 篇相关文章
submitted by /u/lucian-12 [link] [留言]
When people talk about hackathons, they talk about the demo. The pitch, the UI, the "aha" moment on stage. Nobody really talks about the person who spent the whole weekend making sure the data didn't fall apart. That was me on AidStream, a blockchain-based aid distribution platform we built in a weekend and trust me it wasnt that easy as it seems. At a normal project, you can revisit your data model whenever.But during a hackathon you cant since when teamamtes start working on top of your tables it means both codes may start breaking . Serverless Postgres was the right choice for a hackathon: no local DB setup, no "wait, whose laptop has Postgres installed" problem. Everyone could connect to the same instance immediately. The gotcha was connection limits — with multiple people hitting the same database while testing features simultaneously, we ran into connection issues at the worst possible time (an hour before demo). So next time you watch a hackathon demo go off without a hitch, remember — someone probably spent the whole weekend quietly making sure the database didn't have a say in it. If you're the one holding the schema together at 2am, know this — it's not the flashy role, but it's the one that decides whether anyone else's code even runs.
For years, developers have faced the same dilemma when implementing complex search APIs: GET is the correct semantic choice for read-only operations, but query parameters can become extremely long and difficult to manage. POST allows sending a request body, but it's intended for operations that may change server state, making it a poor semantic fit for searches. To bridge this gap, the IETF has introduced a new HTTP method: QUERY (RFC 10008). Why was QUERY introduced? Modern APIs often require complex filtering: nested JSON filters GraphQL-like requests advanced search criteria large lists of IDs geospatial or analytical queries Encoding all of this into a URL is cumbersome and can exceed practical URI length limits. Developers have traditionally worked around this by using "POST" for read-only searches. The problem is that "POST" doesn't express the intent of the request very well. The new QUERY method solves this by allowing clients to send a request body while keeping the operation explicitly safe and idempotent. Key benefits ✅ Request body support Unlike "GET", "QUERY" allows sending structured request data in the message body, making complex searches much easier to model. ✅ Safe by design Like "GET", a "QUERY" request must not modify server state. It clearly communicates that the request is read-only. ✅ Idempotent Repeating the same "QUERY" request produces the same result without additional side effects, allowing clients and intermediaries to safely retry requests after transient failures. ✅ Cache-friendly Unlike the common "POST"-for-search pattern, "QUERY" is designed to work with HTTP caching, enabling better performance and more efficient network usage. ✅ Better API semantics Instead of overloading "POST" for read operations, APIs can now express their intent more accurately: "GET" → simple resource retrieval "QUERY" → complex read operations with a request body "POST" → operations that create or modify state Example Instead of forcing everything into a lo
Python's Memory Model Is Not What You Think It Is Ask most Python developers how Python stores a variable and they will say "it stores the value." This is imprecise in a way that causes real bugs and real confusion in interviews. A precise mental model of how Python stores and retrieves data changes how you read and write code. Python does not store values in variables. Python binds names to objects. The distinction sounds philosophical until you trace code that involves mutation, function arguments, or aliasing. Then it becomes the most practically useful concept in the language. Names Are Not Boxes The box metaphor, which says a variable is a box that holds a value, is how most introductory programming courses explain variables. In many languages this metaphor is close enough to accurate that it does not cause problems. In Python it is wrong in ways that matter. A more accurate metaphor: a Python name is a label attached to an object. The object exists independently in memory. Multiple labels can be attached to the same object. Attaching a new label does not move or copy the object. x = [ 1 , 2 , 3 ] y = x print ( id ( x ) == id ( y )) # True (same object, two labels) When you write y = x , you are not copying the list. You are creating a second label that points to the exact same list object. The Four Operations You Must Distinguish 1. Assignment creates a new binding x = [ 1 , 2 , 3 ] x = [ 4 , 5 , 6 ] # x now labels a completely different object The first list still exists in memory until garbage collected. The name x simply stops pointing to it and now points to the second list. 2. Mutation modifies an existing object x = [ 1 , 2 , 3 ] x . append ( 4 ) # the object x labels is modified in place Any other name pointing to the same object will instantly reflect this change because they look at the same memory location. 3. Augmented assignment on mutable types mutates x = [ 1 , 2 , 3 ] y = x x += [ 4 , 5 ] print ( y ) # [1, 2, 3, 4, 5] (same object, mutated) The
AI coding tools can now write features, edit multiple files, debug code, run commands, and generate tests. But while researching how developers use these tools, I keep seeing the same question: Are AI coding tools actually saving us as much time as they should? The models are becoming more capable, but developers still seem to spend significant time managing context, checking changes, watching usage limits, choosing models, and explaining the same project information again. I’m trying to understand whether these are widespread problems or just isolated experiences. The Problems I'm Investigating Context and Memory Long AI coding sessions can sometimes lose direction. The AI may forget earlier decisions, misunderstand project conventions, suggest previously rejected approaches, or require the developer to explain important context again. This makes me wonder: Should project knowledge disappear when a chat session ends? Would it be useful if the development environment could preserve relevant architecture decisions, coding conventions, previous bugs and fixes, failed approaches, current tasks, and next steps? Agent Reliability Writing code is only one part of development. An ideal agent workflow might look more like: Understand → Plan → Edit → Run → Test → Fix → Verify But how autonomous should that process be? Should the agent complete the entire loop independently, ask before risky actions, or wait for approval at every major step? Models, Usage, and Cost Developers now have access to many models, but choosing between them can become another task. Should developers always choose models manually, or should the development environment select an appropriate model based on task complexity, quality requirements, privacy, speed, and budget? Usage limits are another concern. Some developers report difficulty predicting how quickly their allowance is being consumed. Would real-time usage visibility, spending limits, local model support, or BYOK actually improve the experien
submitted by /u/gingerbill [link] [留言]
DeepSeek vs Qwen vs Kimi vs GLM: Which AI API Actually Wins in 2025? I've spent the last decade designing systems that need to stay up no matter what. 99.9% uptime isn't a marketing slogan for me — it's the difference between a happy customer and a 3am incident call. So when the Chinese model ecosystem exploded with options like DeepSeek, Qwen, Kimi, and GLM, I didn't just glance at the benchmarks. I pulled the levers, watched the dashboards, and stress-tested every endpoint I could get my hands on. Here's what I found after weeks of running these models behind load balancers, instrumenting them with p99 latency tracking, and watching how they behave when you throw production traffic at them. The Multi-Region Reality Nobody Talks About Most comparison articles treat AI APIs like they're interchangeable endpoints you curl against. That's fine for a weekend hackathon. It's dangerous for production. When I'm architecting a service that depends on an LLM, I care about three things before I care about quality: p99 latency under sustained load Failover behavior when a region gets congested Cost per million tokens at the rate I'm actually consuming I ran each of these four providers through a series of synthetic workloads — bursts of 200 concurrent requests, sustained 50 RPS for an hour, and cold-start recovery tests. The numbers told a story that the marketing pages don't. The Data at a Glance Here's the TL;DR before I dive in. DeepSeek gives you the best price-to-performance ratio, full stop. Qwen has the widest catalog of model sizes I've ever seen from a single provider. Kimi costs a premium but earns it on reasoning-heavy workloads. GLM punches above its weight on Chinese-language tasks and offers multimodal support that the others don't. Dimension DeepSeek Qwen Kimi GLM Provider DeepSeek (幻方) Alibaba (阿里) Moonshot AI (月之暗面) Zhipu AI (智谱) Output price range $0.25–$2.50/M $0.01–$3.20/M $3.00–$3.50/M $0.01–$1.92/M Budget pick V4 Flash @ $0.25/M Qwen3-8B @ $0.01/M N/A GL
The capability phase is over For the past two years, the AI conversation has been about...
SK Hynix is experiencing a boom credited to AI. It will ride that to a multibillion-dollar U.S. IPO, expected to take place on Friday.
How I Cut My LLM API Bill by 40x: A Freelancer's Migration Story Last month I almost choked on my coffee when my OpenAI dashboard showed $487.32 for a single client project. That's not profit. That's a panic attack. As a freelancer running a one-person shop, every line item on my monthly expenses gets scrutinized harder than my code reviews. I spent the next weekend stress-testing alternatives, and honestly? I was annoyed at myself for not doing it sooner. The savings are obscene. Let me walk you through exactly what I found, what I migrated to, and how the switch took maybe 20 minutes total. Let me Start With the Damage Here's what I was paying before. OpenAI's GPT-4o runs $2.50 per million input tokens and $10.00 per million output tokens. For one of my retainer clients — a SaaS company whose support chatbot I maintain — I'm pushing roughly 50 million tokens through a month on input and another 15 million on output. Do the math with me: 50M × $2.50 = $125 on input alone. 15M × $10.00 = $150 on output. That's $275/month just for that one client's chatbot. Add my other three active clients and suddenly I'm staring at a $400-500 OpenAI bill every month like clockwork. For a freelancer, that's a third of a client's monthly retainer gone before I even touch my actual engineering hours. Unacceptable. The Alternative Landscape (And Why I Picked What I Picked) I went down the rabbit hole. I tested seven different model providers over a long weekend, ran the same prompts through each, compared output quality, latency, and price. Here's the full breakdown I compiled in a spreadsheet (because yes, freelancers absolutely live in spreadsheets): GPT-4o (OpenAI): $2.50 input / $10.00 output per million tokens. The default. The expensive default. GPT-4o-mini (OpenAI): $0.15 input / $0.60 output per million tokens. Already 16.7× cheaper than its big sibling. DeepSeek V4 Flash (Global API): $0.18 input / $0.25 output per million tokens. Forty times cheaper than GPT-4o. Qwen3-32B (G
Hit a perfect 7-day streak this week, splitting my time between a massive aesthetic pivot in my...
submitted by /u/lIlIlIKXKXlIlIl [link] [留言]
Nordstjernen is a web browser, written from scratch in C, focused on supporting the HTML and CSS standards. It runs on Windows, Mac and Linux, with an Android port in progress. Nordstjernen is built in Norway. submitted by /u/AndreasWeb [link] [留言]
Hey everyone, My background is in high-performance systems architecture and low-level optimization, and recently, the memory bloat in modern AI editors has been driving me crazy (WE OBVIOUSLY CAN DO BETTER, WHY ARENT WE???) So, I decided to build something significantly leaner and minimal. I built Axiom which uses up to 3.7x less memory than Cursor and 33% less than VSCode. To hit this benchmark, I took VSCode OSS and stripped Electron out completely. Instead of relying on the bundled Chromium instance, I made the editor run inside LaVista ( https://github.com/IASoft-PVT-LTD/LaVista ). This allowed me to drop the footprint of three idle windows down to just 759 MB, compared to the 2,802 MB you'd see in Cursor. What I added on top: AxiomAI: A Bring Your Own Key (BYOK) setup with a local autocomplete and local router system. Token Management: Built-in tracking to monitor, analyze, and set hard limits on your API token usage so you never get a surprise bill. FlowViz: A native visualization engine that lets you render plots, flowcharts, and fully interactive 3D scenes directly in the editor. I am currently rolling out the beta and would love for some technical folks to try it out and try to break it. You can check it out and register for the beta here: https://iasoft.dev/software-engineering/products/axiom/ Would def love to hear your thoughts on the native webview approach or answer any questions about the LaVista implementation! submitted by /u/I-A-S- [link] [留言]
I built a small Redis clone in C: a RESP parser, a command table, an append-only file for persistence. Recently I started building the same thing again in Rust, and rebuilding a project I had already finished has taught me more Rust than any from-scratch tutorial. The reason is simple. The second time, the design is already solved. I know what the AOF has to guarantee, what the command table dispatches, what the parser must reject. So none of my attention goes to what to build. All of it goes to how Rust wants it built. That turns the domain into a constant and the language into the only variable. Every difference I hit is pure signal about Rust, not noise about key-value stores. The first difference shows up before any logic runs. In C, I built the substrate first: my own dynamic strings, my own hashmap, my own linked list. Hundreds of lines before a single command worked. In Rust, Vec , String , and HashMap are just there, so that whole layer disappears and I start at the actual command logic. A standard library quietly decides where your project even begins. The sharper difference is in dispatch. In C it is a switch with argument counts I check by hand: if ( argc != 3 ) return err ( "wrong arg count" ); switch ( cmd ) { case CMD_SET : return do_set ( argv [ 1 ], argv [ 2 ]); case CMD_GET : return do_get ( argv [ 1 ]); /* forget a case and it is a runtime bug */ } In Rust the same dispatch is an enum and a match, and the compiler will not build until every case is handled: match cmd { Command :: Set { key , val } => self .set ( key , val ), Command :: Get { key } => self .get ( key ), } Same dispatch. One version cannot ship the missing-case bug I actually shipped in C. If you already know a project cold, rebuild it in the language you are learning. You stop thinking about the problem and start feeling the language.
I built SeamStress. It's a code reviewer with one rule: it only reports what it can prove against your actual code, quoting the exact lines. If it can't prove it, the finding gets demoted to a judgment call. Not presented as fact. That rule is enforced by one small piece of code: the verification gate. It decides whether a finding may be shown as verified_real. Every other part of the tool can be wrong and the damage is bounded. If the gate is wrong, the tool shows you a confident claim it never earned, with a proof label on it, and it renders as success. Silently. So before making the repo public, I ran the tool on the gate. Same pipeline it runs on anyone's code: three blind critics, then synthesis, then per finding verification. Eight model calls. It found two critical defects in its own foundation. Defect one: verified with no evidence behind it The status authority looked like this: const result = verifications . find (( v ) => v . findingId === finding . id ); return result ? result . status : " unverified " ; It trusted the verdict on a finding ID match. It never looked at the evidence. And the schema allowed an empty evidence array and an empty quoted code string. So a result shaped like {status: "verified_real", evidence: []} validated cleanly and certified a finding as proven. The report renderer would put that finding in the headline, under copy promising the exact lines quoted as proof, with nothing attached. The evidence block suppressed the display of the missing proof. It did not remove the finding from the verified set. The fix lives at the authority, not just the schema: if ( ! result ) return " unverified " ; const hasRealEvidence = result . evidence . some (( e ) => e . quotedCode . trim (). length > 0 ); return hasRealEvidence ? result . status : " unverified " ; A verdict is honored only when at least one non empty quote backs it. Checking at the authority also catches the whitespace quote variant that a naive schema minimum would miss. Fixed in
submitted by /u/gcampos [link] [留言]
A visual walkthrough of Linux eBPF. It goes through the basic pipeline: write a small C program, compile it with clang, load it with bpf(), get it past the verifier, JIT it, attach it to a kernel event, and read data back through maps/ring buffers. The second half gets into why people use it for tracing, XDP packet filtering, security hooks, and sched_ext, then ends with the less fun part: the verifier is the safety boundary, and eBPF gets a lot scarier when the person loading the program already has access. submitted by /u/Ok_Marionberry8922 [link] [留言]
Orasort, a sorting algorithm from Oracle, came into the public domain in 2024 after its patent expired, providing massive benefits to open-source software. submitted by /u/Ok_Stomach6651 [link] [留言]
submitted by /u/nee_- [link] [留言]