MurphyA/hacker-news huggingface dataset:
Show HN: Self-hosted RAG with MCP support for OpenClaw
by 2dogsanerd | 2026-02-01 16:45:28+00:00
I've been using OpenClaw to control my home server via WhatsApp, but it couldn't access my documents. Instead of uploading my private contracts to OpenAI, I built ClawRAG – a self-hosted RAG engine that connects to OpenClaw via MCP (Model Context Protocol). Now I can ask "What did the contract say about liability?" and get cited answers, not hallucinations.

Most RAG systems are either too complex for a solo dev's home setup or they rely on cloud-hosted vector stores. I needed something that runs in a single Docker container, understands messy PDFs (tables!), and integrates natively as a "tool" for agents rather than just another REST endpoint.

## Technical Deep Dive

### Why MCP instead of REST?
I chose the Model Context Protocol (MCP) because it provides structured schemas that LLMs understand natively. The MCP server exposes `query_knowledge` as a tool, allowing the agent to decide exactly when to pull from the knowledge base vs. when to use its built-in memory. It prevents "tool-drift" and ensures type-safe responses.

### The Stack
- *Parsing*: Docling 2.13.0 (The first parser I've found that doesn't choke on nested tables in legacy PDFs).
- *Storage*: ChromaDB (Lightweight, file-based, no Postgres/pgvector overhead needed for personal knowledge bases).
- *Search*: Hybrid (Vector similarity + BM25 keyword search) fused using Reciprocal Rank Fusion (RRF) for better retrieval on specific legal jargon.
- *Footprint*: Optimized to run under 2GB RAM (excluding the local LLM).

### The tricky part: Citation Preservation
Getting citations to work reliably over a WhatsApp round-trip was the biggest challenge. I had to ensure chunk IDs and source metadata survive the transformation from ChromaDB → LlamaIndex → LLM → OpenClaw → WhatsApp without getting "summarized away" or sanitized by the LLM's output formatting.

## Use Case
Last week my landlord claimed I signed a clause about garden/snow maintenance. I pulled up my phone, wrote to my OpenClaw bot: "Search my lease for gardening obligations".
It found the relevant paragraph in 3 seconds, cited the page/section, and provided the exact quote. Argument closed.

## Quick Start
The repo includes a `docker-compose.yml` that spins up everything including the vector store:

```bash
# 1. Start ClawRAG
docker compose up -d

# 2. Add your documents
curl -X POST http://localhost:8080/api/v1/rag/documents/upload \
-F "files=@my_lease.pdf" \
-F "collection_name=personal"

# 3. Connect to your agent
openclaw mcp add --transport stdio clawrag npx -y @clawrag/mcp-server
```

## Community & Feedback
Code is MIT licensed. I'd love feedback on the MCP implementation – specifically if you see better ways to handle tool schemas for multi-collection search.

*Ask me anything about the architecture or how I handled the citation logic!*

---

### Hidden Technical Details
- *Privacy*: Zero external data leaks. Everything stays on your metal.
- *LLM Agnostic*: Tested with Ollama (Llama 3.2) and Claude 3.5 via API.
- *Context Management*: Explicit context window limiting to prevent GPU crashes on 8GB VRAM cards.
by estimator7292 | 2026-02-01 16:48:05+00:00
That requires a level of consideration for others that your average American simply cannot comprehend. No stop sign means you have unlimited right of way bestowed by god himself and fuck anyone and everyone else.

The other option is the person who sits at a 4-way stop until all traffic in a one block radius stops before they move, totally ignoring right of way and all sense of safety and propriety.
by positron26 | 2026-02-01 16:49:16+00:00
As a US citizen, when I see the phrase "European digital sovereignty," I'm a bit concerned that our OSS enthusiast and activist allies in that geography are learning to associate American OSS with American tech companies and US government. This could deepen the old free/libre vs open source divide that seems to have polarized along the separation by the Atlantic ocean. If so, in a time where Americans may be soon head-to-head with a runaway tyrannical government, our EU allies will be busy retreating into free/libre commensalist thinking that seem tunnel-visioned on using government funding to escape MS Word, something that is going to be the last thing on their minds if actual sovereignty concerns emerge.

The more general goal will remain to protect all individual freedoms from all tyrannical governments, not to depend on them. It will remain to use better information technology to enhance the functioning of all governments and to create healthy competition in all markets to protect consumer choice. American OSS has not forgotten this one bit. Our country is just having a moment, and it won't help if EU OSS participation writes us off as casualties while EU OSS focuses on "uniquely European" solutions.
Task engine VM – for tasks with executable instructions (progress update)
by tracyspacy | 2026-02-01 16:49:39+00:00
The core idea is Minimal task model + programmable behaviour — a small core that enables unlimited features, since each task can carry executable scripts.

Recent updates:

- VM now uses NaN-boxing technique.

- All stack values are 64-bit (u64) but encode 5 distinct types:
Boolean, String, CallData, U32, and MemSlice (25-bit offset + 25-bit size).

- Added InlineVec — a vector-like structure backed by a fixed-size array. The VM stack, control stack, call stack, and jump stack now use it with defined limits.
- VM has memory now (heap). Memory is simple Vec<u64>, grows dynamically, but technically length is restricted by mem_slice_val format: 25 bits payload for offset and size

Project is still in absolutely early stage.

Repo is here: https://github.com/tracyspacy/spacydo
by andrewflnr | 2026-02-01 16:49:49+00:00
I think this is a rationalization. Humans are always tempted to look up to power, and what's more powerful than an empire? It goes unquestioned that we should respect the Roman empire, for instance, and you pretty often see an argument for the Mongolian empire.But these days, we know that violence is bad so we have to find other reasons to justify our feelings. So we talk about the "peace" they established after all the war. But is the cost really worth it? How many people not attacked by bandits do you need to justify an innocent murderer by raiding soldiers? Never mind that even that "peace" is often sustained through oppression. The Romans didn't invent crucifixion for Jesus, it's something they did. Never mind that the empire never lasts, and plants seeds of the next dozen wars as it falls, watered with yet more blood.

Ask yourself: if you honestly intended to create peace, would a century or more (in the case of Rome) of bloody conquest actually be the optimal plan? I would say no. An actual plan for peace through strength looks more like NATO than Rome.

Any good an empire builder does is accidental. Whatever they tell you or even themselves, they do it for glory and power, and their actions are optimized for that over any actual benefits. They were not nobler than the conquerors and colonizers were rightfully decry today.
by tg1482 | 2026-02-01 16:49:59+00:00
Loopy is a filesystem sandbox whose entire state lives in a single string. It comes with a bash‑style shell so you or your agent can navigate, search, and manipulate a tree‑structured knowledge base with composable commands.

The idea is to simulate a file system to build and navigate a knowledge tree with POSIX-style commands that agents are already familiar with.

Why?
When an agent processes information, it needs somewhere to put it - somewhere it can search, reorganize, and grow organically. For any type of knowledge base like agent memories, product taxonomies, etc the challenge is to expose CRUD type interactions without a pile of specialized tools (search, create, delete, etc.) that are added to context.

Recursive Language Models (RLMs) introduced the idea of putting the entire context into a Python variable and let the model recursively interact with it, instead of reasoning over everything in one shot. RLMs: https://alexzhang13.github.io/blog/2025/rlm/.

I really liked it, but enabling a python REPL seemed like a bad tradeoff for generality.

Loopy imposes a known structure (a tree / filesystem), and replaces the python REPL with a bash syntax over a string. Agents are RL'd in filesystem-like setups, and this provides a sandboxed way to give an agent access to a knowledge base without touching the OS filesystem.

Why this approach:

simple - a single string can represent the full data
known structure - stored in a file system format agents already know and love
composition - compose search commands to quickly navigate the data
by pron | 2026-02-01 16:50:24+00:00
> Not whether it is sound.

Precisely right, but the entire point is that it doesn't need to. The optimisation is applied in such a way that when it is wrong, a signal triggers, at which point the method is "deoptimised".

That is why Java can and does aggressively optimise things that are hard for compilers to prove. If it turns out to be wrong, the method is then deoptimised.
by moron4hire | 2026-02-01 16:50:35+00:00
Android still runs on a monolithic kernel written in a memory-unsafe language. I'm finding it suprisingly difficult to find information on Meadow, other than it runs .NET DLLs as user-space applications, but nothing about the structure of the kernel.

Longhorn was going to be more than that. Microsoft did have Singularity/Midori projects, started around the middle of Longhorn/Vista, and continued much longer after Vista released to build out the managed microkernel concept. It's been about a decade since they've put any work into it, though.
by aaravchen | 2026-02-01 16:51:18+00:00
When I tried that before, the Infuse UI was unusably show for me, likely due to the library size, streaming from my server hung for a long time, it had to transcode most of the time because so few codecs were supported and it only supported stereo audio output. DV wasn't supported at all at the time.

It sounds like it's gotten better by a lot, but I'm curious whether you've had to pay for each newer version if Infuse. They were doing a "for life" purchase before, but that just meant the one major version number, and they were releasing new and EOL old major versions every 1.5-2 years at the time. It seemed like they were heading own the path of a monthly subscription payment model at the time
by aborsy | 2026-02-01 16:51:18+00:00
If your devices are in one network like at home, you have all those things with Wireguard too.

Devices in home LAN all talk to each other, so you have a mesh network.

You need keys for your laptop, phone and remote devices only.
Most nodes are in LAN and don’t need to even run VPN.

With plain Wireguard, you open a single port in a single device. With mesh VPNs you open tons of ports: several ports in coordination, STUN and relay servers, also every device runs a vpn server listening to a port.

You VPN to home and use your home DNS. Your enter ACL rules and DNS server in your router.

I use a mesh VPN but I’m thinking of switching back to Wireguard, my older setup.
by zmgsabst | 2026-02-01 16:51:42+00:00
Your last paragraph is their point: genes are regulated to produce that effect. The genes themselves aren’t doing it, but eg diffusion of chemical signals to inactivate genes.

Morphology is determined by the combination of genes, chemical signals, original cell machinery, and apparently electrical signals. But we never believed that genes determined morphology alone, eg, we know that chemical signals can cause anomalies.
by xenodium | 2026-02-01 16:51:45+00:00
> Keeping your own data as plain text has huge benefits. Having all my chats persistent is good. It's all private.

While agent-shell is much newer than chatgpt-shell, it likely has richer interaction by now (specially the compose interface). I'm veering off topic here... agent-shell now saves all interactions to project/.agent-shell/transcripts as Markdown files. We can totally do org too, but I just haven't gotten to it.
by giantg2 | 2026-02-01 16:51:46+00:00
"I don’t have to think about what I need to test for."

Good luck then. The business process flow including edge cases should arguably be top of mind for what to test. Testing shouldn't be an afterthought but rather an integral thought when writing the code that needs to be tested.

"I would have to have two or three more junior people doing the work"

Yeah, and they're the ones thinking about testing the code they write. Architects (which it sounds like you are an architect and not a dev) don't get into thay much detail.
by Majromax | 2026-02-01 16:52:40+00:00
What is your threat model?

If you're worried about a hostile agent, then indeed sandboxing is not enough. In the worst case, an actively malicious agent could even try to escape the sandbox with whatever limited subset of commands it's given.

If you're worried about prompt injection, then restricting access to unfiltered content is enough. That would definitely involve not processing third-party input and removing internet search tools, but the restriction probably doesn't have to be mechanically complete if the agent has also been instructed to use local resources only. Even package installation (uv, npm, etc) would be fine up to the existing risk of supply-chain attacks.

If you're worried about stochastic incompetence (e.g. the agent nukes the production database to fix a misspelled table name), then a sandbox to limit the 'blast radius' of any damage is plenty.
by PLG88 | 2026-02-01 16:53:38+00:00
Ahh, I see, thanks for clarifying. That was correct, now any OIDC-compatible identity provider (Auth0, Okta, Azure/Microsoft Entra, Google, Keycloak, etc.) is supported on all the tunnelers to my knowledge.

Lots of work continues to go into the UX, but I would note that we focus most of the UI/UX work into NetFoundry, our commercial product.
by JasonADrury | 2026-02-01 16:53:57+00:00
I don't think there's any dispute on what the story is. The blog post here contains the facts, and a rather clumsy attempt by Gyrovague to justify his bid to dox the operator of archive.today.

> Archive.is has more money, resources and ASN's than Akamai

I assume this is a joke, but Archive.is is a shoestring operation funded through donations.
by omoikane | 2026-02-01 16:54:09+00:00
Maybe you are saying this is an improvement over the old days, in that the corporations now at least accept open source contributions, even if they are slow at doing it. I think the contention is that corporations are not merely slow at handling open source contributions, but in fact they are a drain on those contributors time and goodwill because they are incompetent. The end result is that some contributors give up and go elsewhere, and corporate-backed projects lose trust over time.

It might have been better if Oracle just said "we don't have the bandwidth to handle open source and we don't want to waste your time, please submit your patches to this other fork and we will merge when we get around to it."
by maccard | 2026-02-01 16:54:27+00:00
No need to be like that. https://news.ycombinator.com/newsguidelines.html

> Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

Someone comes with an idea? Smile and nod, because ideas are worth the paper they’re printed on. If someone comes to me with a prototype of something that I think is jaw droppinly good, depends on what it is. Internal tool? Ask them what their coworkers think of it. Internal facing admin/feature? Same. User facing feature? Ask them what they think the next step is. The goal is, as you put it, to get everyone on the team trying to tell me it’s a good idea not just one person.
by softwaredoug | 2026-02-01 16:55:21+00:00
Do you find advocating for AI literacy to be controversial amongst peers?

I find, as a parent, when I talk about it at the high school level I get very negative reactions from other parents. Specifically I want high schoolers to be skilled in the use of AI, and particular critical thinking skills around the tools, while simultaneously having skills assuming no AI. I don’t want the school to be blindly “anti AI” as I’m aware it will be a part of the economy our kids are brought into.

There are some head in the sands, very emotional attitudes about this stuff. (And obviously idiotically uncritical pro AI stances, but I doubt educators risk having those stances)
by SpicyLemonZest | 2026-02-01 16:56:17+00:00
> Why is a minimum price more important that a maximum one with guaranteed supply quotas?

Previous attempts to set up a supply chain for these minerals in the West have repeatedly failed because they couldn't compete economically with Chinese production.

> And who trusts the US for that?

The US is the largest consumer and could be a major supplier of these minerals. Their position on this issue is relevant regardless of trust.
by Majromax | 2026-02-01 16:56:32+00:00
Pi supports restricting the set of tools given to an agent. For example, one of the examples in pi --help is:

# Read-only mode (no file modifications possible)
pi --tools read,grep,find,ls -p "Review the code in src/"

Otherwise, "yolo mode" inside a sandbox is perfectly reasonable. A basic bubblewrap configuration can expose read-only system tools and have a read/write project directory while hiding sensitive information like API keys and other home-directory files.
by moeen-mahmud | 2026-02-01 16:57:23+00:00
I've been using Apple Notes and Google Keep for years. I'm a big fan of the simplicity and ease of use. But most of the time, I always forget the keywords to search for a specific note. This project was started as an R&D to see if I can run a language model on a device to make it simple and easier to capture my messy thoughts, voices, tasks, scans, reminders and organize (because I'm a lazy a$$, can't even want to add a title) them in a way that I can easily search for them later. What I wanted to do was dump my thoughts so that it would be easier to retrieve.

I wanted to make it minimal and maximize the privacy and the robustness. After using my app for a few weeks, I believe it would be a good fit for anyone looking for a similar experience.

With this, you can:
- Create notes (on-device LLM will take care of categorizing, tagging, and generating a title)
- Text embeddings based on your notes for semantic search
- OCR for quick scan and extract contents
- Voice capture
- Add tasks and reminders

This is an open-source project, and I'm planning to share the TestFlight link. If you're interested in contributing or joining as a beta tester, please leave a comment.

Thanks for checking this out, good day.

Github: https://github.com/moeen-mahmud/remen
by zimpenfish | 2026-02-01 16:58:16+00:00
As does Perl with `$[`[0][1]

[0] "This variable stores the index of the first element in an array, and of the first character in a substring."

[1] With the caveat: 'As of Perl v5.30.0, or under "use v5.16", or "no feature "array_base"", $[ no longer has any effect"'
by TimorousBestie | 2026-02-01 16:58:34+00:00
They also recently complained about their own experience being downvoted and flagged for ostensibly political reasons, which also cuts against the guidelines. It’s selective adherence at best.

https://news.ycombinator.com/item?id=46773004 (now dead)

Dang is right when he says that every politically-charged commenter thinks their specific ideology is the one that’s oppressed here.
by Klaus23 | 2026-02-01 16:58:41+00:00
They are analysing VLM here, but it's not as if any other neural network architecture wouldn't be vulnerable. We have seen this in classifier models that can be tricked by innocuous-looking objects, we have seen it in LLMs, and we will most likely see it in any end-to-end self-driving model.

If an end-to-end model is used and there is no second, more classical safety model, like the one Mercedes will use in their upcoming Level 2++ driving assistant, then the model can be manipulated essentially without limit. It is realistic to imagine that one printed page stuck on a lamppost could cause the car to reliably crash.
by sodality2 | 2026-02-01 16:58:48+00:00
I've brought my kindle to even the most strict of technology-banned lectures (with punishments like dropping a letter grade after one violation, and failing you after two), and never have they given me a problem when asked. They realize the issue isn't the silicon or lithium, it's the distractions it enables. I'm sure I could connect to some LLM on it, it's just that no one ever will.
by dpc050505 | 2026-02-01 16:58:55+00:00
The 700m people suffering from starvation or malnutrition while we produce excess food would probably rather be digging in the earth with no tools if it meant they got fed.

The Luddites wouldn't have been destroying machines if they had insurance that they would also benefit from the machines, rather than see their livelihoods being destroyed while the boss made more money than ever.
by fc417fc802 | 2026-02-01 16:59:07+00:00
Be careful with the assumptions you're making. A risk management strategy, for example, will often appear to be of zero benefit except in the case where shit hits the fan. We can stop feeding cattle, producing ethanol, and whatever else overnight in the event that something happens.

> Rational policy would create a large scale food shortage and then let market forces take over.

Well I'm just going to state that I'm _really_ happy that you're not the one in charge and leave it at that.
by mbreese | 2026-02-01 16:59:38+00:00
It’s not theater. It introduces friction into the process. And when there is friction in both choices (read the paper, or photograph and upload the photograph), you’ll get more people reading the physical paper copy. If students want to jump through hoops, they will, but it will require an active choice.

At this point auto AI summaries are so prevalent that it is the passive default. By shifting it to require an active choice, you’ve make it more likely for students to choose to do the work.
by nine_k | 2026-02-01 16:59:43+00:00
Reading with AI summaries jumping into your eyes is like writing in a word processor that completes sentences and paragraphs for you.

Writing with a word processor that just helps you type, format, and check spelling is great. Blocking distractions on a general-purpose computer (like a phone or a tablet) is as hard as handing locked-down devices set up for the purpose, and banning personal devices.
by sunshine-o | 2026-02-01 17:00:51+00:00
Thanks for the suggestion !

I looked into it but it seems that port knocking and Single Packet AuthZ literally open the firewall and expose the port when used.

Meaning it is great to reveal the SSH port when needed, do your business quickly and close it back when you are done. But my guess is those overlay networks need to port available all the time, so...
by yl_seeto | 2026-02-01 17:02:03+00:00
One aspect that resonates from stories like this is the tension between opinionated design and real-world utility.

When building something minimal, especially in areas like agent-based tooling or assistants, the challenge isn’t only about reducing surface area — it’s about focusing that reduction around what actually solves a user’s problem.

A minimal agent that only handles edge cases, or only works in highly constrained environments, can feel elegant on paper but awkward in practice. Conversely, a slightly less minimal system that still maintains clarity and intent often ends up being more useful without being bloated.

In my own experience launching tools that involve analysis and interpretation, the sweet spot always ends up being somewhere in the intersection of:
- clearly scoped core value,
- deliberately limited surface, and
- enough flexibility to handle real user variation.

Curious how others think about balancing minimalism and practical coverage when designing agents or abstractions in their own projects.