Cognitive Reasoning & Learning
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/nextjs-architecture-expert.md
- services/api/agents/brain_agents/fact-checker.md
- services/api/agents/brain_agents/agent-expert.md
- services/api/agents/skill_registry/skills/ai-engineer/SKILL.md
- services/api/agents/brain_agents/project-supervisor-orchestrator.md
- services/api/agents/brain_agents/research-coordinator.md
Cognitive Reasoning & Learning in the NeXifyAI platform refers to the "Brain-first" architecture where autonomous agents interact with a centralized knowledge repository (Qdrant) to execute tasks, validate information, and persist new findings. This system ensures that every agent action is grounded in mission context and past experiences, preventing amnesia and enabling continuous self-evolution across the agent mesh.
The platform utilizes the NeXify Cognitive Execution Layer (NCEL), an 8-layer architecture that governs agent lifecycles, intent analysis, and memory persistence. This framework allows agents to learn from execution cycles and share insights via a unified "Brain" layer.
Sources: services/api/agents/brain_agents/nextjs-architecture-expert.md, services/api/agents/brain_agents/agent-expert.md
NeXify Cognitive Execution Layer (NCEL)
The NCEL provides a structured framework for cognitive operations. Every agent integrated into this layer must follow a specific sequence of stages to ensure reasoning accuracy and successful learning.
NCEL Execution Stages
| Layer | Name | Primary Function |
|---|---|---|
| 1 | Trigger Layer | Boots agent via init-agent and maintains heartbeats. |
| 2 | Intent & Context Analysis | Parses intent_payload and classifies intent types. |
| 3 | Skill Discovery | Registers agent capabilities in the Skill Registry. |
| 4 | Skill Matching | Declares authority and resolves domain conflicts. |
| 5 | MCP Routing | Manages external calls via Model Context Protocol. |
| 6 | Agent Execution | Executes the core task logic and delegation protocol. |
| 7 | Monitoring | Emits health and performance metrics (Prometheus/Grafana). |
| 8 | Memory | Persists findings to the Brain (Qdrant) to close the loop. |
Sources: services/api/agents/brain_agents/nextjs-architecture-expert.md:95-167, services/api/agents/brain_agents/agent-expert.md:88-150
Cognitive Workflow Diagram
The following diagram illustrates the standard reasoning and learning loop within the NCEL architecture.
This diagram shows the flow from task initialization to the persistence of new knowledge in the Brain.
Sources: services/api/agents/brain_agents/nextjs-architecture-expert.md:143-167, services/api/agents/brain_agents/search-specialist.md:73-108
Brain-First Mandate
The "Brain-First Mandate" is a non-negotiable protocol requiring agents to query the central repository before performing any action. This reasoning step evaluates past lessons and credibility warnings.
Pre-Execution Reasoning
Before execution, agents query the nexifyai_brain collection for:
- Relevant lessons: Past knowledge regarding the specific task type.
- Credibility warnings: Identification of quarantined or low-trust entries.
- Similar executions: Historical handling of the topic and resulting outcomes.
- Mission alignment: Verification that the action serves the core customer outcome defined at Brain point ID 1.
Post-Execution Learning
After completing a task, agents perform a "Write-Back" to the Brain, providing:
- Provenance: The
agent_idthat performed the work. - Confidence: An honest assessment (0.0-1.0) of the result.
- Findings: Specific results, new facts, or discovered URLs.
- Metrics: Latency, cache hits, and error counts.
Sources: services/api/agents/brain_agents/search-specialist.md:21-33, services/api/agents/brain_agents/nextjs-architecture-expert.md:14-34, services/api/agents/brain_agents/fact-checker.md:14-27
Information Retrieval and Validation
Reasoning is supported by specialized agents that fetch and verify data to ensure the platform's "Collective Intelligence" remains accurate.
Search and Fusion
The search-specialist agent manages complex retrieval reasoning. It uses Query Decomposition to break requests into sub-queries and Hybrid Search to fuse vector (Qdrant HNSW Cosine) and keyword signals.
Sources: services/api/agents/brain_agents/search-specialist.md:35-42
Fact-Checking and Contradiction Detection
The platform treats contradictions as signals for further reasoning (E3.5 Directive 3). The fact-checker agent validates claims by cross-referencing at least two sources and assigning a confidence score. If the score is below 80%, it triggers a correction proposal or escalates the contradiction to the supervisor.
Sources: services/api/agents/brain_agents/fact-checker.md:11-47
Retrieval Logic Sequence
This sequence illustrates how agents collaborate with the Brain and specialized specialists to validate information during reasoning.
Sources: services/api/agents/brain_agents/search-specialist.md:44-65, services/api/agents/brain_agents/fact-checker.md:41-47
Learning and Evolution Strategies
The system evolves through the continuous addition of knowledge points and the optimization of agent skills.
- Skill Acquisition: The
ai-engineerskill implementation follows a pattern of analyzing requirements, querying past implementations in the Brain, and reporting optimization lessons back after coding. - Agent Lifecycle Management: The
agent-expertmanages the evolution of the agent mesh by designing new agents, testing retrieval quality, and archiving (retiring) old versions. - Supervision: The
project-supervisor-orchestratormonitors "Brain-Point-Frische" (freshness of knowledge) and retrieval quality as part of project health monitoring.
Sources: services/api/agents/skill_registry/skills/ai-engineer/SKILL.md:21-36, services/api/agents/brain_agents/agent-expert.md:36-42, services/api/agents/brain_agents/project-supervisor-orchestrator.md:36-42
Summary
Cognitive Reasoning & Learning in NeXifyAI is a closed-loop system governed by the NCEL architecture. By enforcing a Brain-First mandate, the platform ensures that autonomous agents act based on historical context and validated facts. Every execution cycle contributes to the collective intelligence by persisting lessons and metrics back to the Qdrant-based Brain layer, enabling the system to evolve its capabilities and maintain mission alignment across all tasks.