Inspiration
Every company has a knowledge problem. Decisions get made in Slack threads that nobody can find six months later. SOPs live in Notion pages nobody knows exist. A new engineer spends their first two weeks asking the same questions their predecessor asked — because there's no institutional memory.
We built Brainyfy because we kept watching smart teams make the same mistakes twice, not because they were careless, but because their knowledge was scattered, unsearchable, and effectively lost.
The question we wanted to answer: what if you could just ask your company something — and get a cited, trustworthy answer in seconds?
What it does
Brainyfy is a Company Brain — an AI-powered knowledge layer that sits on top of everything your team produces.
- Ingest docs, Slack threads, SOPs, meeting notes, tickets, and URLs
- Ask any question in plain English → get a cited answer grounded in your actual company knowledge
- Explore a live knowledge graph showing how topics, decisions, and documents connect to each other
- Generate runnable playbooks and SOPs from accumulated knowledge on any topic
Every answer comes with source citations. No hallucinations from general training data — only answers grounded in what your company actually knows.
How we built it
Architecture
The stack was designed to be hackathon-fast but production-scalable:
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router) + Tailwind CSS |
| Backend | FastAPI (Python) + async SQLAlchemy |
| Relational DB | PostgreSQL via Neon (serverless) |
| Vector DB | Pinecone (serverless, 768-dim index) |
| Graph DB | Neo4j AuraDB Free |
| LLM | Google Gemini 2.0 Flash |
| Embeddings | Google text-embedding-004 (768 dimensions) |
| Auth | JWT + HTTP-only cookies + bcrypt |
The RAG Pipeline
The core intelligence is a Retrieval-Augmented Generation pipeline:
$$\text{answer} = \text{LLM}(\text{question} + \text{top}_k\text{ chunks from Pinecone})$$
- Every uploaded document is chunked into 512-token segments with 50-token overlap
- Each chunk is embedded via Google
text-embedding-004into a 768-dim vector - Vectors are stored in Pinecone with
org_idmetadata for multi-tenant isolation - At query time: embed the question → cosine similarity search → fetch top 5 chunks → Gemini constructs a cited answer
The Knowledge Graph
After every upload, an auto-linker runs:
$$\text{edge}(A, B) \iff \text{cosine_sim}(\vec{A}, \vec{B}) > 0.75$$
Neo4j stores nodes (knowledge items) and edges (similarity relationships).
The frontend renders this as an interactive force-directed graph using
react-force-graph, letting teams see how their knowledge is connected.
Challenges we faced
Embedding model choice. We started with OpenAI embeddings but needed a
free alternative for the hackathon. After evaluating HuggingFace-hosted
models, we landed on Google's text-embedding-004 — same API key as our
Gemini LLM, 768-dim output, and strong performance on technical content
like SOPs and engineering discussions.
Multi-tenant vector isolation. Pinecone doesn't have native namespaces
on the free tier the way we needed. We solved this by embedding org_id
as metadata on every vector and filtering at query time — clean isolation
without separate indexes.
Chunking strategy for mixed content. Technical docs, Slack threads, and meeting notes have very different structure. A fixed 512-token chunker works well for dense docs but loses conversational context in threads. We added source-aware chunking — threads preserve full message context per chunk, documents use sliding window.
Graph performance. Neo4j AuraDB free has connection limits. We moved to a connection pool singleton and batched edge creation post-ingestion rather than creating edges inline during upload, which dropped ingestion time significantly.
What we learned
- RAG quality is 80% chunking, 20% retrieval. The embedding model matters less than how you prepare the text before embedding it.
- Multi-database architectures are worth the complexity. PostgreSQL for truth, Pinecone for similarity, Neo4j for relationships — each does its job better than any single database could.
- Cited answers change user trust completely. When every answer shows its source, users engage differently — they verify, they explore, they trust the system more.
What's next
- Slack + Notion OAuth connectors — ingest knowledge automatically without manual upload
- Personal knowledge track — individual second brain that grows into a team brain as colleagues join
- Knowledge gap detection — flag questions the system couldn't answer well, surfacing what the company doesn't have documented
- Agent API — expose Brainyfy as a tool other AI agents can call, turning it into a memory layer for the entire AI stack
Built With
- fastapi
- knowledgegraph
- langchain
- nextjs
- python
- rag
- typescript


Log in or sign up for Devpost to join the conversation.