Neuron AI is a PHP framework for building AI applications in which agents connect language models, tools, data loaders, vector databases, memory, and user interfaces. PHP developers use it to create and manage applications with agent workflows, multi-agent coordination, streaming, monitoring, and human involvement.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add neuron-core/neuron-ai --skill neuron-raggit clone --depth 1 https://github.com/neuron-core/neuron-aiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/neuron-core/neuron-ai/neuron-rag)<a href="https://agentmods.dev/skills/neuron-core/neuron-ai/neuron-rag"><img src="https://agentmods.dev/badge/skills/neuron-core/neuron-ai/neuron-rag/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/neuron-core/neuron-ai/neuron-rag"><img src="https://agentmods.dev/badge/skills/neuron-core/neuron-ai/neuron-rag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00127 | $0.05431 |
| Opus 5.5 | $0.00051 | $0.02172 |
| Sonnet 5.5 | $0.00025 | $0.01086 |
| Haiku 4.5 | $0.00013 | $0.00543 |
Grade A, and why
neuron-rag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- neuron-rag — 91% identical, 28 lines differ
How it starts
The opening of the file, as written. The whole thing — 523 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Neuron AI RAG
This skill helps you implement Retrieval-Augmented Generation (RAG) in Neuron AI. RAG extends Agent — it inherits everything an agent can do (chat, stream, structured output, tools, persistence, thread identity) and replaces the entry chain with retrieval:
AgentStartEvent → PreProcessNode → RetrievalNode → PostProcessNode → InstructionsNode → inference
- Pre-process the user question (query rewriting/expansion)
- Retrieve relevant documents from the vector store
- Post-process (re-rank, filter by score)
- Send the documents with the question, as context of the turn, and run the normal inference
The documents are not added to the instructions and not stored in the chat history. They reach the model in the question's own message, after the question, inside <EXTRA-CONTEXT> tags:
system <your instructions>
user <the question>
<EXTRA-CONTEXT> ...retrieved documents... </EXTRA-CONTEXT>
Write instructions that fit this position, such as "answer from the context that follows the question". When nothing is retrieved, the question is sent alone. Because the instructions no longer change with each question, they and the conversation can be cached: see "Turn context" in the neuron-agent skill.
Core Components
- Embeddings provider — converts text to vectors (
EmbeddingsProviderInterface) - Vector store — stores and searches document embeddings (
VectorStoreInterface) - Retrieval strategy — how a query becomes a document list (
RetrievalInterface) - Pre/post processors — query transformation and result re-ranking/filtering
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\RAG\Embeddings\EmbeddingsProviderInterface;
use NeuronAI\RAG\Embeddings\OpenAIEmbeddingsProvider;
use NeuronAI\RAG\RAG;
use NeuronAI\RAG\VectorStore\PineconeVectorStore;
use NeuronAI\RAG\VectorStore\VectorStoreInterface;
class MyChatBot extends RAG
{
protected function provider(): AIProviderInterface
{
return new Anthropic(
key: $_ENV['ANTHROPIC_API_KEY'],
model: 'ANTHROPIC_MODEL',
);
}
protected function embeddings(): EmbeddingsProviderInterface
{
return new OpenAIEmbeddingsProvider(
key: $_ENV['OPENAI_API_KEY'],
model: 'OPENAI_EMBEDDING_MODEL',
);
}
protected function vectorStore(): VectorStoreInterface
{
return new PineconeVectorStore(
key: $_ENV['PINECONE_API_KEY'],
indexUrl: $_ENV['PINECONE_INDEX_URL'],
);
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago Changed · +10 lines 49eb7ff798c6
- 15d ago First seen · 513 lines · 127 tokens per session scan A 8c18091198bc
neuron-rag is a skill published in the GitHub repository neuron-core/neuron-ai (2,140 stars, last pushed yesterday), licensed MIT. It adds 127 tokens to every session and 5,431 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.
Other skills, from other repositories
neuron-rag
Implement RAG (Retrieval-Augmented Generation) with Neuron AI including vector stores, embeddings providers, document loaders, retrieval strategies, and metadata filtering. Use this skill whenever the user mentions RAG, retrieval, vector search, document retrieval, semantic search, knowledge bases, chat with…
agent-v3-memory-specialist
Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.
embeddings
Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.
unified-llm-api
Call model APIs through @prismshadow/mmsp (MMSP) — streaming text generation, image generation, speech synthesis, embeddings and the supported-model registry with one client.
building-agents
Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…
neuron-tool
Create custom tools, toolkits, and MCP integrations for Neuron AI agents. Use this skill when the user mentions creating tools, building toolkits, extending Tool class, defining tool properties, implementing tool execution, MCP server integration, Model Context Protocol, connecting external tools, multimodal tool…