Every company wants an AI assistant that knows everything. The very next sentence is always the same worry: what happens when it shows the intern the salary sheet?

Most "company brain" demos skip that question. They index every document and answer from whatever they find. For Graph Hacks 2026 (WeMakeDevs × FalkorDB) I built the opposite: a company brain whose first job is knowing who is allowed to know what.

It's called Need-to-Know.

The Need-to-Know brain view

Access is a chain, and chains are a graph problem

Inside a real company, access is rarely "this person can open this file". It looks more like this:

Priya is in Support. Support is part of All Staff. All Staff was added to Drive migration 2023 (temporary). Three years ago, that group was given the salary sheet.

Nobody remembers that last step. Nobody can answer "who can actually see this?" with confidence. And a chatbot that answers from every document makes that hidden chain everyone's problem.

A chain of memberships is exactly what a graph database is built for. In FalkorDB, one query returns everything a person or an AI agent can read, through any depth of nested groups:

MATCH (p:Principal {id: $pid})-[:MEMBER_OF*0..8]->(g:Principal)-[:CAN_READ]->(t) RETURN DISTINCT t.id 

The median time is 0.45 ms, which is fast enough to run on every question and every agent step. Permissions are never cached, so there's no stale access to worry about.

What Need-to-Know does

I generated a realistic company, Northwind Labs: 211 people, 9 teams, 19 nested groups, 21 documents and chats, 3 customers and 3 AI agents. I also hid three real-world mistakes in it for the brain to find.

1. A brain you can watch think

The whole company graph is drawn inside a brain:

  • Leadership sits in the frontal lobe and teams across the top.
  • Customer-facing teams are at the back.
  • Documents live in the memory lobe and AI agents in the cerebellum.
  • FalkorDB is the brain stem.

When you ask a question, signals travel from you, through your groups, to each document FalkorDB allowed. Blocked documents get a red signal that stops short. The animation follows the exact path the database used, so it's an honest picture of how the answer was found.

2. Same question, different people, different answers

Ask "Why did Acme Corp's invoice go up in October?" as Priya, a Support intern:

  • She gets the answer from the pricing policy: loyalty discounts last 12 months and aren't renewed automatically. Every fact is cited with its source and owner.
  • She does not get the contract value or the invoice runs. Instead she sees a locked line: "Contract value and discount. Needs Finance or Leadership access. Ask Arjun Mehta."

Now ask the same thing as Meera, Head of Finance, and the hidden lines become real answers. A "See how someone else sees this" box puts the two answers side by side.

The brain doesn't pretend restricted things don't exist, and it doesn't leak them either. It tells you what's missing and who to ask.

3. "Why can I see this?"

Every fact has a button that shows the shortest chain of groups behind it, for example Priya → Support → All Staff → Company handbook. Access stops being a mystery.

4. Private memory for every person and every agent

The brain remembers what you asked before. Each memory hangs off its owner's node in the graph, and every memory query starts at your node. That means there is simply no path from me to your memories. The demo proves it: "Priya has 4 memories. Meera can reach 0."

5. AI agents follow the same rules as people

Agents are members of groups, just like people, so they get exactly the access their groups have.

In the demo, the Support Agent and the Finance Agent share customer ticket #4821. The Finance Agent adds a Finance-only note with the contract details. When the case goes back to the Support Agent, that note is redacted, so the reply to the customer can't leak it. If a draft reply does contain private Finance data, the approve step refuses to send it.

Agents sharing a case without leaking

6. The brain checks itself

The Health check compares who should open each sensitive document with who actually can, and found all three planted problems:

  • Salary bands 2026: 211 people can open it instead of 3, all through that forgotten "Drive migration 2023 (temporary)" group.
  • Q3 board update: 34 people instead of 5, through a project group.
  • Ravi Kumar moved from Finance to Engineering but is still in the Finance group. That one stale membership alone unlocks 5 things.

The part I'm proudest of: every suggested fix is tested on a full copy of the company first, using FalkorDB's GRAPH.COPY. The brain forks the graph, applies the fix, and checks that the right people lost access and that everyone who should keep access still has it. Then it deletes the copy. Only after that does a human approve, and the change is saved as a decision record that the brain can explain later.

Health check with a fix tested on a copy

How FalkorDB is used

  • Variable-length traversal (MEMBER_OF*0..8) for access, explanations and "who can read this?"
  • Full-text index (db.idx.fulltext.queryNodes) to find candidate passages. Access is then checked on every single one.
  • GRAPH.COPY to test access fixes on a fork before touching the real company.
  • One graph per company. Northwind and a second company, Bluefin, live side by side and never mix.
  • Read-only queries for everything an asker can trigger.
  • An MCP server, so any MCP-compatible AI agent can ask the brain questions under its own identity.

The number that convinced me the graph matters

I wrote the access rules a second time in plain Python as an independent ground truth. Then I ran 54 askers × 8 questions through three kinds of access check:

Access check Leaks Wrong denials Helpfulness
Graph traversal (Need-to-Know) 0 0 100%
Flat permission list (direct groups only) 0 521 37.5%
No check (a plain document chatbot) 840 0 100%

The graph traversal agreed with the Python ground truth on 100% of 6,634 (person, passage) pairs.

A flat permission list is safe but nearly useless: people got only 37.5% of what they were entitled to see. No check is helpful but leaks 840 times. Only the graph is both safe and helpful, because only the graph understands groups inside groups.

What broke along the way

  • No Docker on my laptop. FalkorDB doesn't run natively on Windows, so I ran everything against a real FalkorDB in GitHub Actions instead. It turned out to be the best decision of the weekend. Every push runs 13 tests, the benchmark, a container build and screenshots of every screen, then redeploys the live demo.
  • Answers that drifted. My first search ranked anything mentioning "Acme" highly, so asking why Acme's invoice went up returned Acme's liability cap. Now I drop passages that match only on a customer's name, and favour policies and decisions for "why" questions.
  • One line of CSS. display: flex on my tab panels silently beat the browser's hidden attribute, so every tab rendered at once. [hidden] { display: none !important; } fixed it.
  • Container paths. My first Dockerfile used find to locate the FalkorDB module, but find isn't in the image. Reading the image config showed it lives at /var/lib/falkordb/bin/falkordb.so.

What I'd build next

  • Connectors that import real groups and documents from Google Workspace, Slack and Notion.
  • A live alert when a new share suddenly widens access to something sensitive.
  • Time travel: "who could see this document last March?"

Try it

Thanks to WeMakeDevs and FalkorDB for Graph Hacks. Building this made one thing very clear to me: a company brain is only as trustworthy as its sense of who is allowed to know what.

GraphHacks #FalkorDB #WeMakeDevs