Umoren/permissioned-organizational-brain

A permission-first organizational brain demo that reconstructs decision history without exposing inaccessible evidence.

★ 1Forks 0JavaScriptGitHub ↗Compare

Project website ↗

README

Why did we make this decision?

Test

Six months after a major decision, the reason is often buried across company tools. This demo turns that history into a short decision brief. Ada and Ben ask the same question, but their roles give them access to different records. Each person receives an answer based only on records they can open.

Switch between Ada and Ben in the product interface. The decision stays the same. The answer changes because each person has a different evidence boundary.

Open the live product demo

The public deployment uses Railway. The Node application receives the public domain, while HelixDB stays on Railway's private network. See DEPLOYMENT.md.

Run the product demo

You need Docker with Docker Compose. Start the complete demo with one command:

docker compose up --build

Open http://127.0.0.1:3000. HelixDB runs inside the same Compose project.

When you finish, stop both services:

docker compose down

What this proves

A graph-defined permission set can constrain semantic retrieval before evidence reaches a language model.

The demo makes the claim inspectable. This directory contains the query and synthetic graph. It also contains the returned context and leak tests.

The scenario

A private pilot review changes the enterprise launch date. A later company release adds the features that the pilot customers needed.

Ada can read the private product strategy source and the company roadmap. Ben can read only the company roadmap. The private customer research belongs to the product strategy source. The public release update belongs to the company roadmap.

An unrelated executive message has the strongest possible vector match. Neither person can access its source, so the query excludes it.

Verified result

Viewer Returned evidence Answer behavior
Ada Private pilot review and company release update Explains why the launch moved and what the company shipped afterward.
Ben Company release update only Reports what shipped and states that the available records do not explain why the launch moved.

The response contains stable evidence keys and vector distances. It does not contain raw embeddings or internal HelixDB node IDs.

The browser interface rejects a response if it contains either of those internal fields. It also rejects the wrong viewer, question, or query order.

How the query works

The retrieval path starts with the viewer. The graph finds the sources that the viewer can access, then finds evidence from those sources. Vector ranking runs inside that exact evidence set. The application sends only allow-listed fields to the answer builder.

Permission filtering happens before semantic ranking

The editable D2 source and publication PNG are in docs/.

The application does not run an unrestricted vector search and filter the results afterward. HelixDB receives the allowed graph traversal as the input to vector_search_nodes_within.

The application API accepts only the two synthetic viewers and one fixed question. It does not expose HelixDB's raw POST /v2/query endpoint.

Run it without Compose

You need:

  • Node.js 20 or newer.
  • Docker.
  • Port 6969 for HelixDB.
  • Port 3000 if you run the application API.

The demo has no npm package dependencies.

Start HelixDB

Run the official HelixDB v0.0.4 image:

docker run --rm -d \
  --name organizational-brain-helixdb \
  -p 127.0.0.1:6969:8080 \
  ghcr.io/helixdb/helixdb:v0.0.4

Check that the database is ready before you run the integration test:

curl -fsS http://127.0.0.1:6969/readyz

The response must contain "ready":true.

Run the tests

The local tests inspect the query shape and response boundary. They also check for leaks, invalid inputs, and unsafe public API routes:

npm test

The live HelixDB test is separate. It seeds a new synthetic fixture and runs the same question as Ada and Ben:

npm run test:integration

The local suite covers the query, response boundary, public server, and browser presentation contract. The live suite has one HelixDB integration test. Both suites passed on 2026-08-26.

Inspect the two answers

Print the full response and query trace for Ada and Ben:

npm run demo

Notice that Ada receives two evidence records. Ben receives one. Ben's JSON has no private message text or evidence key. It also has no private channel name or source metadata.

Open the viewer interface

Start the demo server after HelixDB is ready:

npm start

The server seeds a new fixture and listens on http://127.0.0.1:3000. Open that address in a browser. Ada loads first. Select Ben to run the same question with his smaller source-access set.

The page presents the result as a decision brief. It shows the answer and the company records that support it. Technical readers can open the optional proof to inspect the permission order. The page calls the application API each time the viewer changes. It does not use client-side fixture data.

You can also inspect the API directly. In another terminal, send the fixed question as Ben:

curl -sS http://127.0.0.1:3000/api/ask \
  -H 'content-type: application/json' \
  --data-binary '{
    "viewer": "ben",
    "question": "Why did we delay the enterprise launch, and what changed afterward?"
  }'

The API also exposes GET /health and GET /api/question. Any request to /v2/query returns 404.

Project map

Path Purpose
src/helix/ HelixDB request builders and client.
src/domain/fixture.js Synthetic people, sources, decisions, and evidence.
src/domain/query.js Permission-first vector query.
src/domain/retrieval.js Input checks, safe context, and deterministic answer.
src/server.js Fixed public API and allow-listed static assets.
public/ Responsive viewer comparison and permission proof.
test/ Query, leak, API, interface, and live database tests.
docs/ Editable D2 diagram source and rendered files.

Why the demo uses JSON requests

HelixDB now publishes its version 3 TypeScript software development kit as @helix-db/helix-db. This demo still sends the documented operation-tree JSON directly to POST /v2/query. The direct request keeps the permission query visible and keeps the demo free of npm package dependencies.

See the HelixDB filtering guide and local server guide.

Current limits

  • The data is synthetic.
  • The viewers and question are fixed.
  • Channel membership does not refresh from Slack.
  • The answer is deterministic. No language model runs.
  • The demo proves one retrieval boundary. It is not a production authorization system.
  • The in-memory HelixDB container loses its data when it stops.

Stop the local database when you finish:

docker stop organizational-brain-helixdb

This implementation is released as an application repository. It is not an npm package.

License

This project uses the MIT License.

Contributors

Umoren

Issues