3 2 weeks ago

NeuroGraph bridges natural language queries with deep semantic ontologies, deterministic code verification, and real-time inference.

ollama run yakkshit/neurograph

Models

View all →

Readme

🧠 NeuroGraph by CedzLabs

A production-grade Cognitive Router that thinks in Knowledge Graphs, not tokens.

NeuroGraph bridges natural language queries with deep semantic ontologies, deterministic code verification, and real-time inference.


🎯 What Problem Does This Solve?

Traditional LLMs are expensive, slow, and act as β€œblack boxes.” You ask a question, get an answer, but have no idea how it arrived there.

NeuroGraph is different. It’s a 17.8M parameter Deep-Narrow transformer trained to: 1. Structure thoughts as knowledge graphs (nodes + edges) 2. Score confidence explicitly (0.0 to 1.0) 3. Route intelligently β€” handle 80% of queries locally, escalate only complex tasks

This saves 80% on AI costs while making decisions transparent and auditable.


πŸš€ Quick Start

ollama run yakkshit/neurograph "Debug this Python error: IndexError: list index out of range"

πŸ“Š Model Specifications

Property Value
Parameters 17.8 Million
Architecture Deep-Narrow Transformer (24 layers, dim=256)
Positional Encoding Split-Half RoPE
Vocabulary 8,192 (Custom BPE)
Quantization Q4_K_M (4-bit)
Model Size 13MB
Context Window 512 tokens

πŸ—οΈ Architecture

Deep-Narrow Design

Unlike wide models, NeuroGraph uses 24 thin layers (dim=256) instead of a few wide ones. Research shows depth beats width for small parameter budgets β€” it forces the model to process information step-by-step, mimicking logical deduction.

Split-Half RoPE

Implements Rotary Position Embedding with split-half attention for efficient sequence modeling.

Custom Training

Trained on 35,668 examples from: - Code: Python instructions & debugging scenarios - Reasoning: GSM8K mathematical reasoning - Knowledge: QASC knowledge graphs - Synthetic: Custom MCP tool-calling patterns


Output Format

NeuroGraph outputs structured JSON knowledge graphs, not raw text:

{
  "output_type": "debug_graph",
  "nodes": [
    {
      "id": "error",
      "type": "issue",
      "content": "Python IndexError: list index out of range",
      "confidence": 0.95,
      "source": "model_knowledge"
    },
    {
      "id": "context",
      "type": "code",
      "content": "<NEEDS_MCP:read_file>",
      "confidence": 0.4,
      "source": "pending_mcp",
      "mcp_tool": "read_file",
      "mcp_args": {"path": "target.py"}
    }
  ],
  "edges": [
    {"from": "error", "to": "context", "relation": "occurs_in"}
  ]
}

πŸ”§ Use Cases

1. Cognitive Routing

Use NeuroGraph as the first stage in a cascading inference system: - High confidence (β‰₯0.8): Return answer directly - Medium confidence (0.4-0.8): Trigger MCP tools to fetch live data - Low confidence (<0.4): Escalate to GPT-4/Claude with rich context

2. Code Debugging

Automatically parse errors, identify root causes, and suggest fixes with confidence scores.

3. Knowledge Graph Construction

Transform natural language queries into structured semantic graphs for visualization or database storage.

4. API Tool Calling

Convert user intents into precise API calls with parameter extraction.


πŸ“‘ API Integration

NeuroGraph exposes an OpenAI-compatible API when run with llama-cpp-python or deployed via Docker:

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="not-needed"
)

response = client.chat.completions.create(
    model="neurograph",
    messages=[
        {"role": "user", "content": "Debug this Python error: IndexError"}
    ],
    temperature=0.1,
    max_tokens=250
)

print(response.choices[0].message.content)

🐳 Docker Deployment

docker run -d -p 8000:8000 \
  -e MODEL_PATH=/models/neurograph-q4_k_m.gguf \
  -v ./models:/models \
  yakkshit/neurograph-api

Training Details

Dataset Composition

  • 18,195 code generation & debugging examples
  • 7,473 step-by-step reasoning problems (GSM8K)
  • 5,000 knowledge graph relationships (QASC)
  • 5,000 synthetic MCP tool-calling patterns

Training Configuration

  • Epochs: 8
  • Batch Size: 8
  • Learning Rate: 3e-4 with cosine decay
  • Final Loss: 0.30
  • Framework: PyTorch + Custom GGUF Exporter

πŸ” Security & Privacy

  • Local-first: Runs entirely on your machine or private cloud
  • No telemetry: Zero data collection
  • API Key authentication: Optional bearer token protection
  • Deterministic output: Temperature 0.1 for reproducible results

πŸ“ˆ Performance

Metric Value
Inference Speed ~50 tokens/sec on CPU (M1 Mac)
Memory Usage ~100MB RAM
Cold Start <2 seconds
Auto-scaling 1-5 replicas on Azure Container Apps

Ecosystem


Built by CedzLabs

Engineered for production AI systems. NeuroGraph is part of the CedzLabs Cognitive Suite, designed to solve hallucination, opaque reasoning, and untraceable AI decisions.

License: MIT
Status: Production-Ready (2026 Standard)


πŸ™ Acknowledgments

  • Built with PyTorch, llama.cpp, and Hugging Face datasets
  • Architecture inspired by Deep-Narrow transformer research
  • Training data from open-source public datasets