FalkorDB
Solutions
Use cases
Why FalkorDB
Developers

Company Brain: How a Graph on FalkorDB Doubled AI Agent Accuracy Over RAG

Company brain: an AI agent at the center of people, chat, docs, code, tickets and calendar in a graph

Every company has a brain. It's spread across tickets, pull requests, docs, chat threads and a few people's heads. Ask an AI assistant who decided something, why, or whether it still applies, and it finds the paragraph that looks most similar and hopes for the best. Graph Hacks, FalkorDB's online hackathon, drew 7,899 developers and 1,213 projects. In its Company Brain track, 458 teams built agents on FalkorDB that actually understand how an organization works. The best one more than doubled answer accuracy over retrieval, using the same model.

Key takeaways. On a 1,203-question test it never saw during development, a company brain built on a FalkorDB graph scored 80.0 against 39.2 for retrieval with the same model, while sending about a fifth of the tokens. The difference comes from questions that cross several hops, like who fixed the bugs customers later reopened. The strongest projects kept every fact linked to its source, tracked whether decisions still stand, and gave agents fixed, read-only queries instead of free-form access.

Build your own company brain. Start free on FalkorDB Cloud and load your first graph today.

What is a company brain?

A company brain is a knowledge graph of how an organization works, its people, teams, systems, decisions and documents and the connections between them, that AI agents query to answer questions with evidence. FalkorDB is the graph database underneath, with vector and full-text search in the same engine, read-only queries for agents, and a separate graph per team, product or customer. It's the same idea as giving enterprise AI agents a context layer instead of a bigger context window.

Company brain vs. search over documents

QuestionSearch over documentsCompany brain on FalkorDB
Who decided this, and why?Finds a paragraph that mentions itFollows the decision to the people and sources behind it
Does this still apply?Old and new versions look the sameFollows the chain of what replaced what
Who fixed the bugs customers reopened?Guesses from similar textJoins people, fixes, bugs and dates in one query
Show me the evidenceQuotes something similarReturns the path and the source record IDs
Can the agent change company data?Depends on the toolNo, it only gets fixed read-only queries

How did Graph Hacks teams build a company brain?

1. Answer the multi-hop questions retrieval gets wrong

inherit-brain · Zeyu Sun · See the code · Use the app · Blog

A new maintainer inherits a product and asks a simple question. Who wrote the fixes for bugs that customers later reopened? Answering it means connecting people to pull requests, pull requests to bugs, and bugs to dated reopen events. Retrieval with the same model named four other engineers and scored zero.

Zeyu loaded Salesforce AI Research's HERB enterprise dataset into 30 FalkorDB product graphs, 56,708 nodes and 164,698 edges, where every edge keeps the IDs of the records it came from. The agent picks from nine fixed tools that run parameterized Cypher through GRAPH.RO_QUERY under a read-only user for each product. Then he froze the graphs and tested on 1,203 questions the system had never seen.

inherit-brain demo
MATCH (b:Bug) WHERE b.reopened = true
  AND ($components IS NULL OR b.component IN $components)
  AND ($companies IS NULL OR any(x IN b.companies WHERE x IN $companies))
MATCH (pr:PR)-[fx:FIXES]->(b)
MATCH (p:Person)-[op:OPENED]->(pr)
MATCH (b)-[hs:HAS_EVENT]->(rs:BugEvent) WHERE rs.type = 'RESOLVED' AND pr.link IN rs.fix_pr_links
MATCH (b)-[:HAS_EVENT]->(ro:BugEvent) WHERE ro.type = 'REOPENED' AND ro.ts > rs.ts
RETURN p.eid, p.name, p.role, b.id, pr.link, op.src, fx.src + hs.src, [rs.id]

That join returns the answer in 13 ms, with the source record for every hop.

Approach (same model)ScoreMedian input tokens
Graph tools on FalkorDB80.010,117
Retrieval tools, same model39.246,451
Whole product in one prompt26.0125,947
Hybrid RAG19.25,176
In the builder's words. "GRAPH.RO_QUERY rejects write queries on the server, so the tools' read-only contract holds even if a tool's Cypher were wrong." Zeyu Sun, inherit-brain

Try it. Pick one question your team keeps asking that crosses three systems, and write it as one Cypher query. Start free on FalkorDB Cloud.

2. Trace every decision to its source, and know if it still stands

Lineage · Anmol Gupta · See the code · Use the app · Blog

Python's design decisions are public but scattered across 26 years of proposals, forum threads and rulings. So the same ideas, like do-while loops, switch statements and better lambdas, keep coming back, and core developers keep re-explaining old rulings. Every company has its own version of this problem.

Lineage turns that history into one FalkorDB graph of 745 PEPs, 1,085 rejected ideas as their own nodes, 1,748 discussion threads and 2,175 people. Ask "has Python already decided this?" and it returns the ruling, who made it, whether the idea came back, quoted sources, and who to ask, with the graph path and the exact Cypher it ran.

Lineage demo
MATCH path = (p:PEP {number: $n})<-[:REJECTED_IN]-(a:Alternative)-[c:CITES]->(q:PEP)
WHERE (p)-[:REJECTS_APPROACH_OF]->(q)
RETURN path, q.number, q.status, a.title, CASE WHEN coalesce(c.quote, '') = '' THEN a.text ELSE c.quote END, a.url

And to check whether a ruling still stands, it follows the chain of proposals that replaced it to the latest one.

MATCH path = (p:PEP {number: $n})<-[:SUPERSEDES*1..6]-(latest:PEP)
WHERE NOT ()-[:SUPERSEDES]->(latest)
RETURN path, latest.number, latest.status ORDER BY length(path) DESC
In the builder's words. "Vector search, full-text search and graph algorithms in one engine. A question can go from a semantic match straight into a multi-hop traversal without a second datastore or a sync job between them." Anmol Gupta, Lineage

Try it. Add a SUPERSEDES edge every time a decision or policy changes, and your agent will always know which one is current. Start free on FalkorDB Cloud.

Three more company brain ideas worth stealing

Fix the answers you already gave. Ripple, by Sahil Mane and Harsh Gupta, records every answer its assistant gives as an edge in a FalkorDB graph to the exact version of the fact it used. When a policy changes, one traversal finds every person, agent and cached plan still holding the old version, blocks stale agent actions, and goes back to tell people "Earlier I told you..." Watch the demo.

Join systems that never talk to each other. Blackbox, by Divyam Singh and Manish Modak, puts 4,235 NTSB accident investigations and 225,627 FAA maintenance reports into one FalkorDB graph, joined by aircraft and by location on the airframe. For Southwest Flight 812, it shows cracks on the same stringer line rising from 9 to 18 to 31 aircraft in the years before the 2011 rupture. Watch the demo.

Keep docs true to code. Staleproof, by Raj Karia, indexes code and docs across repositories into one FalkorDB graph. When a function changes, it follows the calls to every doc paragraph and code example that the change could make wrong, even in another repository. In one test across three repos, it reached 120 affected doc sections, 46 of them outside the repo that changed. Watch the demo.

Building agents that need to remember, not just look things up? Read 5 agent memory patterns from 647 Graph Hacks projects.

Frequently asked questions

What is a company brain?

A company brain is a knowledge graph of how an organization works, including its people, teams, systems, decisions and documents, that AI agents query to answer questions with evidence. It answers questions like who decided something, whether it still applies, and who knows a part of the system.

How is a company brain different from RAG?

RAG finds text that looks similar to a question. A company brain stores how facts connect, so it can answer questions that cross several hops and show the path behind the answer. In one Graph Hacks test with the same model, graph tools scored 80.0 and retrieval tools 39.2 on 1,203 held-out questions. Read more on where the GraphRAG accuracy gap comes from.

How do you keep a company brain up to date?

Store changes as new facts linked to the ones they replace, instead of overwriting. Then the agent can tell what is current, and you can find everyone who was told the old version.

How do you stop an AI agent from changing company data?

Give the agent a small set of fixed, parameterized queries instead of free-form database access, and run them read-only. On FalkorDB, GRAPH.RO_QUERY rejects writes on the server, and each team or product can have its own graph and read-only user.

How do I build a company brain on FalkorDB?

Start with one question your team keeps asking, load the systems that answer it into one graph joined on shared IDs, and expose a few read-only queries to your agent through the FalkorDB MCP server or the Python or Node.js client.

Give your agents a company brain

Every project here runs on the same FalkorDB you can start with one Docker command, docker run -p 6379:6379 -p 3000:3000 -it --rm falkordb/falkordb:latest, or a free cloud instance. Load two systems your team uses, join them on one shared ID, and ask the question nobody can answer today.

Start free on FalkorDB Cloud

Not ready to build yet? Join the FalkorDB Discord to get help from our engineers, share what you build, and hear about the next Graph Hacks first.

Author