Hawkfry
All case studies
AIKnowledge Management

Where Should a Company Brain Live? Files, Graph Database or Postgres

When an AI answers a question about your business, it first has to find the answer. The more it has to read on the way, the longer you wait and the more you pay, because you are charged for everything an AI model reads.

Our company brain holds what Hawkfry knows as plain text files, and our AI agents answer from it. We wanted to know whether a database would let them find things with less reading. We also wanted to know whether it had to be a graph database, or whether the database we already run would do.

Demo data. Every test on this page ran in December 2026 on our demo company brain. It is a copy of our real one in which every client, person and meeting is fictional.

What we decided: build the brain on Postgres, beside our CRM and timesheets, and give our agents three tools to work with it.

Queries
Agents write their own read-only queries over the notes and the links between them.
Search
A search that matches on meaning as well as exact words, for answers buried in long meeting notes.
Checked writes
New meetings are filed through a tool that matches each name to a person already in the brain, does not guess when it is unsure, and keeps search up to date.

The Six Tests

TestWhat we comparedWinnerWhat it showed
1Files or a DatabaseObsidian files, Neo4j and Postgres, on 20 questions1st Neo4jAll three gave the same answers. The databases needed about a third of the reading and about half the time.
2Own Queries or Ready-Made ToolsAgents writing their own queries against agents using fixed commands, on the same 20 questions1st Neo4j, own queriesAn agent writing its own queries read less than one given ready-made tools.
3Adding Search by MeaningPostgres with and without the extra search, on the 6 questions answered from written notes1st Neo4jIt did not help on short, tidy notes, and it added reading.
4Database Speed and MemoryNeo4j, FalkorDB and Postgres, with no agents involved1st PostgresAll three were fast enough. Postgres was the fastest and used the least memory.
5Filing a New MeetingFiles, direct Neo4j writes and a checked write tool1st Checked write toolAll three filed it correctly, but only the checked tool kept search up to date.
6Building the Brain From TranscriptsOpen extraction (the NVIDIA txt2kg approach) against guided extraction (the Graphiti approach)1st Guided (Graphiti)Checking names against known people matched 35 of 38 attendees. Without the check, 2 were matched and 36 duplicates were created.

Every test used the same demo brain of 978 notes and ran on our own machine. The agents ran on the same large language model each time, and we fixed the correct answers before any run.

Two terms appear in the tables. Text read is counted in tokens, the units a language model reads and is billed in. A tool call is one lookup made by the agent.

1Files or a Database

We wrote 20 questions of the kind a team asks about its own business, such as who someone is, when we last met a client and what was decided with them. Each agent looked up the answers in the same notes, which were held as Obsidian files, as a Neo4j graph and as Postgres tables.

Ranked by correct answers, then by the least text read.

RankCorrectText readTool callsTime
1stNeo4j20 / 207.5k tokens34154 s
2ndPostgres20 / 209.5k tokens35135 s
3rdObsidian files20 / 2027.1k tokens82276 s

A database gave the same answers for about a third of the reading, in about half the time. All three agents answered all 20 questions correctly. The gap was widest on questions about dates, lookups and relationships, where the database agents read up to 18 times less. Two things in our setup affect these numbers. Our command checker refused 18 of the files agent’s 82 commands, which cost it calls and time. The database tools also cut long notes off at 400 characters, so those agents read long notes in slices. You can replay every question below.

Watch the Agents Work

Pick a question to replay how each agent answered it. Every dot is a note, and the lines show which notes the agent opened. The medals rank the three agents on that question, by a correct answer first and then by the least text read. Each replay keeps the pace of the real run but is sped up.

Apart from Jamie Fry, which people attended meetings with both Norhaven Logistics and Claimbridge?

Obsidian files

Answered
0
tool calls
0
tokens read
0
notes touched

Neo4j

Answered
0
tool calls
0
tokens read
0
notes touched

Postgres

Answered
0
tool calls
0
tokens read
0
notes touched
All three answered correctly

Imran Qureshi and Simon Radley.

Where the Gap Comes From

The text each agent read across all 20 questions, grouped by the kind of question and counted in tokens.

2Own Queries or Ready-Made Tools

We asked the same 20 questions again. This time one agent wrote its own Neo4j queries, and another could only use fixed commands that we had built for it, such as “get company” and “timeline”.

Ranked by correct answers, then by the least text read.

RankCorrectText readTool callsTime
1stNeo4j20 / 207.5k tokens34154 s
2ndPostgres20 / 209.5k tokens35135 s
3rdNeo4j, ready-made tools20 / 2011.7k tokens23138 s
4thObsidian files20 / 2027.1k tokens82276 s

The agent did better writing its own queries than using tools we had built for it. Every agent still got all 20 right. The agent with ready-made tools needed the fewest calls but read 1.6 times as much, because a fixed command returns everything it might be asked for, whether or not the question needs it. That also means less to build. The agent can be given read-only access and left to ask for exactly what it needs.

3Adding Search by Meaning

Six of the 20 questions have answers that sit in the text of a note and not in the links between notes. For these we gave one Postgres agent an extra tool that finds notes by meaning as well as by exact words.

Ranked by correct answers, then by the least text read.

RankCorrectText readTool calls
1stNeo4j6 / 64.2k tokens19
2ndPostgres6 / 65.0k tokens18
3rdPostgres + search6 / 67.2k tokens19
4thObsidian files6 / 69.5k tokens13

Search by meaning is not worth adding until your notes need it. The demo notes are short and tidy, so the text search built into Postgres found every answer, and the agent with the extra search tool read 44% more. We expect search by meaning to earn its place on long, messy meeting notes, where the exact words often miss.

4Database Speed and Memory

We ran the same operations on the same data in each database and timed them, with no agents involved.

Ranked by read speed, then by memory.

RankDatabaseLoadMemoryRead a companyWrite a meeting
1stPostgres1.2 s121 MB6.6 ms26 ms
2ndNeo4j4.2 s1.41 GB21.9 ms57 ms
3rdFalkorDB23.9 s879 MB78.4 ms49 ms

Any of the three is fast enough, so speed alone should not decide the choice. Postgres was the fastest on 8 of the 10 operations we timed, and it needs less than a tenth of the memory Neo4j does.

5Filing a New Meeting

Each agent filed the same new meeting from rough notes. The notes used first names only, introduced a person the brain had not seen before, referred to a client by its initials and contained two decisions.

Ranked by score, then by whether search could find the meeting, then by time.

RankApproachScoreFindable by searchTool callsText readTime
1stChecked write tool10 / 10Straight away81.1k tokens44 s
2ndObsidian files10 / 10After a rebuild1410.4k tokens52 s
3rdDirect Neo4j writes10 / 10No89.5k tokens43 s

An AI that writes to the brain needs a tool that checks its work. All three approaches filed the meeting correctly, but only the checked write tool left it findable by search straight away, and it read about a tenth of the text the other two did. The agent writing directly to Neo4j did not update search at all, so its meeting was filed but search could not find it. The test also caught a mistake in our own tool. On its first run it linked the new person to someone else with the same surname, so we fixed it and ran the test again.

6Building the Brain From Transcripts

We wrote eight meeting transcripts for the demo, based on its meeting notes. Each one uses first names only and contains one misheard name. Open extraction records names as they were heard, which is the approach NVIDIA’s txt2kg takes. Guided extraction has to match each name to someone already in the brain, which is the approach Graphiti takes.

Ranked by attendees matched, then by duplicates created.

RankApproachAttendees matchedWrong matchesDuplicatesFlagged for reviewDecisions recoveredDecisions right
1stGuided (Graphiti approach)35 / 3800879%51%
2ndOpen (NVIDIA txt2kg approach)2 / 38036086%30%

If names are not checked against the people you already know, the brain fills up with duplicates. Open extraction caught slightly more decisions but was right less often: 30% of what it called a decision really was one, against 51% for guided. It also filed almost every person as someone new. Guided extraction created no duplicates, and it flagged the 8 names it could not settle so that a person could choose. You can see where each name ended up below.

Where Each Name Ends Up

This is test 6. Pick a meeting to see each name heard in the transcript and where each approach filed it.

Matched to the right personMatched to someone else who existsFlagged as ambiguousDuplicate of an existing personNew person

Open extraction

    Guided extraction

      Company Brain Storage FAQs

      Do AI agents need a graph database to use a company brain?

      No. In our tests the agents answered all 20 questions correctly from plain files, from a graph database and from Postgres. The graph database read the least text: 7.5k tokens, against 9.5k for Postgres and 27.1k for the files.

      Is Postgres or Neo4j better for a company brain?

      For us it was Postgres. Neo4j read about a fifth less text across the 20 questions, but Postgres was faster on 8 of the 10 operations we timed and used 121 MB of memory against 1.41 GB.

      What This Means for Your Business

      You probably do not need a graph database to give AI a working memory of your business. In our tests Postgres was the fastest and lightest of the three databases, and it came close to the graph database on reading. It is also where our CRM and timesheets already live, which is why we are building our brain there.

      You can read how our company brain works, or get in touch to talk through what one would look like for your team.

      Ready to put applied AI to work?

      Tell us about your business and we'll map the fastest path to measurable results.