Logo di Agent Brain

Agent Brain

Organizzazione
SpillwaveSolutions

Local-first RAG memory for AI agents: hybrid + GraphRAG search, MCP server with OAuth 2.1, plugin for Claude Code / OpenCode / Codex.

AutoreSpillwaveSolutions
Repositoryagent-brain
LinguaPython
Fork
23
Stelle
119
Strumenti disponibili
0
Tipo di trasportostdio
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Agent Brain mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    119 stelle e 23 fork nel repository collegato.


last_validated: 2026-03-16

Agent Brain

A RAG-based (Retrieval-Augmented Generation) document indexing and semantic search system for AI agents and applications. Agent Brain enables intelligent querying of documentation and source code using natural language.

Overview

Agent Brain provides AI-first document and code search through a Claude Code plugin with skills, commands, and agents. Use slash commands to search, agents for complex research tasks, and skills for intelligent query optimization.

ComponentDescription
Plugin30 slash commands, 3 agents, 2 skills for Claude Code
SkillsIntelligent search mode selection and query optimization
AgentsResearch assistant, search assistant, setup assistant
ServerFastAPI backend for indexing and retrieval
CLICommand-line tool (also used by plugin internally)

Quick Start (Claude Code Plugin)

1. Install the Plugin

bash
# 1. Add the Agent Brain marketplace (the repo is a plugin marketplace)
claude plugins marketplace add SpillwaveSolutions/agent-brain

# 2. Install the plugin from that marketplace
claude plugins install agent-brain@agent-brain-marketplace

Installing a Claude Code plugin does not use pip. The plugin is installed through the marketplace above; the underlying Python packages (agent-brain-rag, agent-brain-cli) are installed for you by the /agent-brain-setup wizard (or manually via pip — see CLI Usage).

Other hosts

The same plugin installs into Codex, Cursor, Grok Build, and OpenCode through the CLI. Each command converts the shared payload into the host's native layout and, with --with-mcp, registers the MCP server in that host's config file.

bash
pip install agent-brain-rag agent-brain-cli agent-brain-ag-mcp
agent-brain install-agent --agent codex --with-mcp     # .codex/skills/agent-brain + AGENTS.md; MCP in ~/.codex/config.toml
agent-brain install-agent --agent cursor --with-mcp    # .cursor/plugins/agent-brain + .cursor/rules; MCP in .cursor/mcp.json
agent-brain install-agent --agent grok --with-mcp      # .grok/plugins/agent-brain; zero-config Claude load, MCP in .mcp.json
agent-brain install-agent --agent opencode --with-mcp  # .opencode/plugins/agent-brain; MCP in opencode.json

A conforming Agent Plugins 1.0 client reads agent-brain-plugin/plugin.json, skills/, and mcp.json directly. See docs/HOSTS.md for the manifest each host reads.

2. Set Up Your Project

In Claude Code, run:

/agent-brain-setup

This interactive wizard will:

  • Install the Python packages (agent-brain-rag, agent-brain-cli)
  • Configure your API keys
  • Initialize the project
  • Start the server
  • Index your documentation

3. Search with Commands

/agent-brain-search "how does authentication work"

That's it! The plugin handles everything automatically.

Plugin Commands

Search Commands

CommandDescriptionUse When
/agent-brain-searchSmart hybrid search (recommended)General questions
/agent-brain-semanticPure semantic/vector searchConceptual queries
/agent-brain-keywordBM25 keyword searchError messages, function names
/agent-brain-hybridHybrid with alpha tuningFine-tuned searches
/agent-brain-graphKnowledge graph search"What calls X?", dependencies
/agent-brain-multiAll modes combined (RRF)Maximum recall

Server Commands

CommandDescription
/agent-brain-startStart the server (auto-port)
/agent-brain-stopStop the server
/agent-brain-statusCheck health and document count
/agent-brain-indexIndex documents or code

Setup Commands

CommandDescription
/agent-brain-setupComplete guided setup wizard
/agent-brain-installInstall pip packages
/agent-brain-initInitialize project directory
/agent-brain-verifyVerify configuration
/agent-brain-providersConfigure embedding/summarization providers

Plugin Agents

Agent Brain includes three intelligent agents for complex tasks:

AgentDescriptionTriggered By
Search AssistantMulti-step search across modes, synthesizes answers"Find all references to...", "Research how..."
Research AssistantDeep exploration with follow-up queries"Investigate...", "Analyze the architecture of..."
Setup AssistantGuided installation and troubleshooting"Help me set up Agent Brain", configuration issues

Example Agent Interaction

You: "Research how authentication is implemented across the codebase"

Research Assistant:

  1. Searches documentation for auth concepts
  2. Queries code for auth-related functions
  3. Uses graph mode to find dependencies
  4. Synthesizes comprehensive answer with references

Plugin Skills

Skills provide intelligent context to Claude for optimal searching:

SkillPurpose
using-agent-brainSearch mode selection, query optimization, API knowledge
configuring-agent-brainInstallation, provider configuration, troubleshooting

When you ask about documentation or code, Claude automatically uses the skill to:

  • Choose the best search mode for your query
  • Set appropriate parameters (top_k, threshold, alpha)
  • Interpret and synthesize results

Search Modes

ModeBest ForExample Query
HYBRIDGeneral questions (default)"How does caching work?"
VECTORConceptual understanding"Explain the architecture"
BM25Exact terms, error codes"NullPointerException", "getUserById"
GRAPHRelationships, dependencies"What classes use AuthService?"
MULTIComprehensive search"Everything about data validation"

Pluggable Providers

Agent Brain supports multiple providers for embeddings and summarization:

Embedding Providers

ProviderModelsLocal
OpenAItext-embedding-3-large, text-embedding-3-smallNo
Ollamanomic-embed-text, mxbai-embed-largeYes
Cohereembed-english-v3.0, embed-multilingual-v3.0No

Summarization Providers

ProviderModelsLocal
Anthropicclaude-haiku-4-5-20251001, claude-sonnet-4-5-20250514No
OpenAIgpt-5, gpt-5-miniNo
Geminigemini-3-flash, gemini-3-proNo
Grokgrok-4, grok-4-fastNo
Ollamallama4:scout, mistral-small3.2, qwen3-coderYes

Fully Local Mode

Run completely offline with Ollama:

/agent-brain-providers
# Select Ollama for both embeddings and summarization

Features

Code Search

  • 10 Programming Languages: Python, TypeScript, JavaScript, Java, Kotlin, C, C++, C#, Go, Rust, Swift
  • AST-Aware Chunking: Tree-sitter parsing preserves code structure
  • LLM Summaries: AI-generated descriptions improve semantic search
  • Language Filtering: Filter results by programming language

GraphRAG (Knowledge Graph)

  • Entity and relationship extraction
  • Dependency-aware queries ("What calls X?")
  • Code structure visualization

Multi-Instance Architecture

  • Per-project isolated servers
  • Automatic port allocation
  • Work on multiple projects simultaneously

Project Structure

agent-brain/
├── agent-brain-plugin/        # Claude Code plugin (primary interface)
│   ├── commands/              # 30 slash commands
│   ├── agents/                # 3 intelligent agents
│   └── skills/                # 2 context skills
├── agent-brain-server/        # FastAPI backend
├── agent-brain-cli/           # CLI tool (used by plugin)
└── docs/                      # Documentation

Documentation

Getting Started

Reference

Architecture

CLI Usage (Alternative)

While the plugin is the recommended interface, you can also use the CLI directly:

bash
# Install
pip install agent-brain-rag agent-brain-cli

# Initialize and start
agent-brain init                     # auto-generates a per-project API key
agent-brain start --daemon

# Index and query
agent-brain index /path/to/docs --include-code
agent-brain query "authentication" --mode hybrid

Note on authentication. As of the next release, every data endpoint requires X-API-Key. agent-brain init writes a 32-byte urlsafe key into .agent-brain/config.json (mode 0o600); the CLI and agent-brain-mcp pick it up automatically. Pass --no-api-key to agent-brain init for the legacy no-auth experience on 127.0.0.1. The server refuses to start on any non-loopback bind without a key set. See docs/CHANGELOG.md under the unreleased entry for the full design (Issue #179).

Development

Prerequisites

  • Python 3.10+
  • Poetry (dependency management)
  • Task (task runner)

Setup

bash
git clone https://github.com/SpillwaveSolutions/agent-brain.git
cd agent-brain
task install

Running Tests

bash
task test           # All tests
task before-push    # Full quality check

Technology Stack

  • Plugin: Claude Code slash commands, agents, skills
  • Server: FastAPI + Uvicorn
  • Vector Store: ChromaDB (HNSW, cosine similarity)
  • BM25 Index: LlamaIndex BM25Retriever
  • Graph Store: SimplePropertyGraphStore / Kuzu
  • Embeddings: OpenAI or Ollama
  • Summarization: Claude, GPT-5, Gemini, Grok, or Ollama
  • AST Parsing: tree-sitter (10 languages)
  • CLI: Click + Rich
  • Build System: Poetry

Contributing

See the Developer Guide for setup instructions.

Before pushing changes, always run:

bash
task before-push

License

MIT License - see LICENSE file for details.

Links

Usa MCP Agent Brain con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Agent Brain, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Agent Brain come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Agent Brain.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "agent-brain": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Agent Brain, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Agent Brain.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Agent Brain per aiutarmi con questa attività?
Agent Brain
Certo. Ho letto.
Ecco cosa ho trovato con Agent Brain.

Domande frequenti

A cosa serve il server MCP Agent Brain?

Agent Brain è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Agent Brain MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Agent Brain con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Agent Brain con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Agent Brain, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Agent Brain MCP a TypingMind?

Agent Brain funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Agent Brain MCP in TypingMind?

Agent Brain mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Agent Brain MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Agent Brain richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇