The Brain (Knowledge Graph)
Relevant source files
The following files were used as context for generating this wiki page:
- services/api/agents/brain_agents/search-specialist.md
- services/api/agents/brain_agents/ai-engineer.md
- services/api/agents/brain_agents/project-manager.md
- services/api/agents/brain_agents/research-coordinator.md
- services/api/agents/brain_agents/metadata-agent.md
- services/api/agents/brain_agents/fact-checker.md
- services/api/agents/brain_agents/legal-expert.md
- SETUP.md
The Brain serves as the central knowledge management system and shared memory layer for the NeXifyAI platform. It operates as a vector-based knowledge graph that persists structured information, mission contexts, agent registries, and cross-project data to enable autonomous AI decision-making. By integrating high-performance vector search with lexical matching, the Brain ensures that every agent action is informed by historical lessons and real-time session state.
This system functions as a "Brain-first" mandate for all platform agents. Before executing any task, agents must query the Brain to assess credibility, alignment with the mission, and similar past executions. This unified memory prevents amnesia across the agent mesh and allows for collective intelligence growth.
Sources: services/api/agents/brain_agents/ai-engineer.md, services/api/agents/brain_agents/search-specialist.md
Core Architecture and Technology Stack
The Brain architecture relies on a hybrid storage model combining vector databases for semantic retrieval and relational databases for structured audit logs.
- Vector Engine: Uses Qdrant for high-dimensional vector storage (4096-dim Cosine similarity) and semantic search. It manages multiple collections including
nexifyai_brain,hermes_brain, andnexifyai_enterprise_brain. - Memory Layer: Integrates
mem0for persistent brain memory. - Embeddings: Utilizes
all-MiniLM-L6-v2embeddings via Qdrant for processing text into searchable vector points. - Relational Storage: Employs Supabase (PostgreSQL) for
brain_notes,knowledge_base, and task-related evidence.
Vector Collections Summary
| Collection Name | Purpose | Data Volume Example |
|---|---|---|
hermes_brain | Core system prompts and system-level knowledge. | 72+ points |
nexifyai_enterprise_brain | Enterprise-specific documentation, networking, and governance. | 3004 points |
nexifyai_brain | General knowledge, agent registries, and session history. | Variable |
Sources: services/api/agents/brain_agents/ai-engineer.md, SETUP.md, services/api/agents/brain_agents/search-specialist.md
Brain-First Execution Flow
All agents follow a strict 8-layer NeXify Cognitive Execution Layer (NCEL) protocol where the Brain is consulted at the beginning and end of every cycle.
The diagram shows the mandatory loop where the Brain provides the initial context and receives the final results to close the cognitive loop.
Sources: services/api/agents/brain_agents/ai-engineer.md, services/api/agents/brain_agents/search-specialist.md
Retrieval and Search Mechanisms
The Brain employs a Search Specialist agent to manage information retrieval. This agent fuses multiple search signals to ensure high precision and context awareness.
Search Strategies
- Vector Search: Uses Qdrant HNSW Cosine similarity for semantic matching.
- Keyword Matching: Performs lexical search via payload-filtered matching.
- Hybrid Search: Combines semantic and lexical signals, filtered by category or source.
- Reranking: Applies a cross-encoder over the merged top-k candidates to refine relevance scores.
- Web Retrieval: If internal knowledge is insufficient, the system fetches external data via BeautifulSoup, parser results are then injected back into the Brain.
Sources: services/api/agents/brain_agents/search-specialist.md
Knowledge Metadata and Governance
The Metadata Agent and Legal Expert ensure the consistency and compliance of information stored within the Brain.
Metadata Tagging Schema
Information in the Brain is categorized using specific fields to facilitate discovery and validation:
- Category:
agent_registry,knowledge_skill,enterprise_doc,governance,system-prompt. - Type:
agent_definition,skill_definition,document,code,metric. - Credibility Signals: Provenance,
confidence_score(0.0-1.0),cross_review_score, andquarantine_score.
Data Integrity and Credibility
The Brain implements a quarantine mechanism. If an entry has a quarantine_score > 0.7 or a status of "quarantined", agents are mandated to flag it and seek verified alternatives. The Fact Checker agent cross-references Brain claims against a "Source of Truth" (e.g., GitHub for code, ADRs for architecture).
Sources: services/api/agents/brain_agents/metadata-agent.md, services/api/agents/brain_agents/fact-checker.md, services/api/agents/brain_agents/legal-expert.md
Integration with Agent Mesh
The Brain acts as the central registry for the 25+ specialized agents in the platform. Every agent registration includes its definition, capabilities, and embedding in the agent_registry category.
The sequence illustrates how the Brain facilitates agent discovery and mission alignment during complex multi-agent workflows.
Sources: services/api/agents/brain_agents/ai-engineer.md, services/api/agents/brain_agents/project-manager.md
Summary
The Brain is the foundational intelligence layer of NeXifyAI. It centralizes all platform knowledge, from technical system prompts to legal compliance audits. By enforcing a "Brain-first" mandate and utilizing a sophisticated hybrid search architecture, it ensures that autonomous agents remain aligned with the core mission: making work faster, safer, and more joyful through verifiable and persistent collective memory.