powerbrain CLAUDE.md

powerbrain CLAUDE.md is an instructions file for coding agents from nuetzliches/powerbrain. It costs 13,337 tokens per session, scanned A, original, Apache-2.0.

Project instructions for Powerbrain, an open-source context engine that gives AI agents controlled access to enterprise knowledge. It describes its services, data stores, policy checks and directory structure.

In plain words
What is it for?
Use it when working on Powerbrain’s MCP server, policy checks, search, summarisation, privacy protection, databases or containerised services.
Why use it?
It explains how the project’s components fit together and how access to company information is governed and audited.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/nuetzliches/powerbrain/claude-md
Clone the repo
git clone --depth 1 https://github.com/nuetzliches/powerbrain

Wrote 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.

agentmods badge for powerbrain CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nuetzliches/powerbrain/claude-md.svg)](https://agentmods.dev/instructions/nuetzliches/powerbrain/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nuetzliches/powerbrain/claude-md"><img src="https://agentmods.dev/badge/instructions/nuetzliches/powerbrain/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 13,337 This file is loaded in full into every session.
When invoked 13,337 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.13337 $0.13337
Opus 5 $0.06668 $0.06668
Sonnet 5 $0.02667 $0.02667
Haiku 4.5 $0.01334 $0.01334

Measured 4d ago against content hash 51dd51884084, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

powerbrain CLAUDE.md scanned grade A with 1 finding 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X PUT "http://localhost:6333/collections/$col" \
CLAUDE.md · 696 lines

How it starts

The opening of the file, as written. The whole thing — 696 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md — Powerbrain Context Engine

Project Overview

Open-source context engine that feeds AI agents with policy-compliant enterprise knowledge. Agents access data exclusively through the Model Context Protocol (MCP). All components are open source and run as Docker containers. Self-hosted, GDPR-native.

Architecture

Agent/Skill
    │ MCP
    ▼
┌─────────────────────────────────────────────────┐
│  MCP Server (FastAPI, 28 tools)                  │
│  ├─ OPA Policy Check (every request)            │
│  ├─ Qdrant Vector Search (oversampled)          │
│  ├─ Reranker (Cross-Encoder, Top-N)             │
│  ├─ Context Summarization (OPA-controlled)      │
│  ├─ Sealed Vault (PII pseudonymization)         │
│  ├─ PostgreSQL (structured data)                │
│  └─ Audit Log (GDPR-compliant)                  │
└─────────────────────────────────────────────────┘
    │           │           │           │
    ▼           ▼           ▼           ▼
 Qdrant    PostgreSQL     OPA       Reranker
 (vectors)  (data+vault+graph) (policies) (Cross-Enc.)
    │
    ▼
 Ollama / vLLM / TEI
 (embeddings + summarization, configurable)

Directory Structure

powerbrain/
├── CLAUDE.md              ← You are here
├── README.md              ← Quick start and overview
├── docker-compose.yml     ← All services
├── .env.example           ← Environment variables
├── shared/
│   ├── __init__.py
│   ├── config.py           ← read_secret(), build_postgres_url(), pool sizes
│   ├── llm_provider.py     ← OpenAI-compat LLM provider abstraction
│   ├── telemetry.py        ← OTel init, trace_operation, MetricsAggregator
│   ├── rerank_provider.py  ← Configurable reranker backend (Powerbrain/TEI/Cohere)
│   ├── drift_check.py      ← Embedding drift detection (Art. 15)
│   ├── embedding_cache.py  ← In-process TTL cache for embeddings
│   └── tests/
│       ├── test_llm_provider.py
│       ├── test_rerank_provider.py
│       ├── test_telemetry.py
│       ├── test_embedding_cache.py
│       └── test_drift_check.py
├── mcp-server/
│   ├── server.py          ← MCP Server (28 tools)
│   ├── graph_service.py   ← Knowledge Graph (Apache AGE)
│   ├── compliance_doc.py  ← EU AI Act Annex IV generator
│   ├── policy_admin_page.py ← (reserved for future UI)
│   ├── Dockerfile
│   └── requirements.txt
├── reranker/
│   ├── service.py         ← Cross-Encoder service
│   ├── Dockerfile
│   └── requirements.txt
├── ingestion/
│   ├── pii_scanner.py     ← PII detection (Presidio)
│   ├── pii_config.yaml    ← PII scanner config (entity types, custom recognizers)
│   ├── retention_cleanup.py ← GDPR retention cleanup jobs
│   ├── sync_service.py    ← Repository sync orchestration (incremental)
│   ├── repos.yaml.example      ← Repository sync configuration template
│   ├── office365.yaml.example  ← Office 365 sync configuration template
│   ├── adapters/
│   │   ├── base.py        ← NormalizedDocument, SourceAdapter ABC
│   │   ├── git_adapter.py ← Git adapter (include/exclude, skip patterns)
│   │   ├── providers/
│   │   │   └── github.py  ← GitHub REST API (PAT + GitHub App auth)
│   │   └── office365/     ← Office 365 adapter (separate package)
│   │       ├── adapter.py       ← Office365Adapter(SourceAdapter)
│   │       ├── graph_client.py  ← Auth, $batch, RU-tracking, retry
│   │       ├── content.py       ← markitdown + fallback extraction
│   │       ├── requirements.txt ← msal, markitdown, python-docx, etc.
│   │       ├── providers/
│   │       │   ├── sharepoint.py ← SharePoint/OneDrive (Delta Query)
│   │       │   ├── outlook.py    ← Outlook Mail (Delta Query)
│   │       │   ├── teams.py      ← Teams Messages (Delta Query + dedup)
│   │       │   └── onenote.py    ← OneNote (Delegated Auth, no delta)
│   │       └── tests/
│   ├── Dockerfile
│   └── requirements.txt
├── init-db/
│   ├── 001_schema.sql     ← Base schema
│   ├── 002_privacy.sql    ← Privacy extensions
│   ├── 003_knowledge_graph.sql ← Apache AGE graph setup
│   ├── 007_pii_vault.sql  ← Sealed Vault (PII originals + mappings)
│   ├── 014_audit_hashchain.sql ← Tamper-resistant audit log (Art. 12)
│   ├── 015_human_oversight.sql ← Circuit breaker + approval queue (Art. 14)
│   ├── 016_data_quality.sql    ← Quality scoring (Art. 10)
│   ├── 017_accuracy_monitoring.sql ← Drift detection (Art. 15)
│   ├── 018_repo_sync_state.sql    ← Repository sync state tracking
│   └── 019_sync_state_delta.sql   ← Delta link support for Office 365
├── opa-policies/pb/
│   ├── data.json           ← Policy data (configurable without Rego knowledge)
│   ├── policy_data_schema.json ← JSON Schema for data.json validation
│   ├── access.rego         ← Access control (logic only, data from data.json)
│   ├── rules.rego          ← Business rules (logic only)
│   ├── privacy.rego        ← GDPR policies (logic only)
│   ├── summarization.rego  ← Context summarization policies (logic only)
│   ├── proxy.rego          ← Proxy policies (logic only)
│   ├── oversight.rego      ← Human oversight policies (Art. 14)
│   └── ingestion.rego      ← Data quality gate policies (Art. 10)
├── caddy/
│   └── Caddyfile           ← Reverse proxy config (optional TLS profile)
├── secrets/
│   └── .gitkeep            ← Docker Secrets directory (*.txt files gitignored)
├── monitoring/
│   ├── prometheus.yml      ← Prometheus config
│   ├── alerting_rules.yml  ← Alert rules
│   ├── tempo.yml           ← Distributed tracing config
│   ├── grafana-dashboards/ ← Provisioned dashboards
│   └── grafana-datasources/← Provisioned data sources
├── pb-proxy/
│   ├── proxy.py           ← Main FastAPI application
│   ├── auth.py            ← API-key auth (ProxyKeyVerifier, asyncpg)
│   ├── middleware.py      ← ASGI auth middleware (global pb_ key validation)
│   ├── tool_injection.py  ← Multi-server MCP tool discovery + merge
│   ├── agent_loop.py      ← Tool-call execution loop with server routing
│   ├── mcp_config.py      ← MCP server config model + YAML loader
│   ├── config.py          ← Configuration
│   ├── litellm_config.yaml← LLM provider config (+ provider_keys section)
│   ├── mcp_servers.yaml   ← MCP server connections (name, URL, auth)
│   ├── Dockerfile
│   └── requirements.txt
├── worker/
│   ├── scheduler.py       ← APScheduler setup + job registration
│   ├── jobs/
│   │   ├── accuracy_metrics.py  ← Art. 15 drift + feedback refresh
│   │   ├── audit_retention.py   ← Art. 12 checkpoint + prune
│   │   ├── gdpr_retention.py    ← GDPR retention cleanup
│   │   ├── pending_review_timeout.py ← Art. 14 review expiry
│   │   └── repo_sync.py        ← GitHub/Git repository sync trigger
│   ├── Dockerfile
│   └── requirements.txt
├── scripts/
│   ├── quickstart.sh          ← Automated first-time setup (--seed / --demo flags)
│   ├── build-images.sh        ← Docker image build script
│   ├── seed_graph.py          ← Knowledge-graph seed (used by pb-seed in demo mode)
│   └── seed_*.py              ← Test data seeding scripts
├── demo/
│   ├── app.py                 ← Streamlit entry (pb-demo container)
│   ├── mcp_client.py          ← MCP HTTP wrapper + vault-token builder
│   ├── panels/
│   │   ├── search_roles.py    ← Tab A — OPA role contrast
│   │   ├── pii_vault.py       ← Tab B — scan/ingest/reveal vault flow
│   │   └── knowledge_graph.py ← Tab C — NovaTech org-chart (streamlit-agraph)
│   ├── assets/talk_track.md   ← Presenter cheat-sheet (rendered in sidebar)
│   ├── Dockerfile
│   └── requirements.txt
├── tests/
│   ├── integration/           ← E2E smoke tests (gated behind RUN_INTEGRATION_TESTS=1)
│   └── load/
│       ├── locustfile.py      ← Locust load test for MCP search pipeline
│       └── README.md          ← Load test instructions
├── SECURITY.md                ← Vulnerability reporting policy
└── docs/
    ├── getting-started.md          ← Step-by-step tutorial for newcomers
    ├── playbook-sales-demo.md      ← 15-min decision-maker demo script (Tabs A/B/C)
    ├── mcp-tools.md                ← All 23 MCP tools with parameters and access roles
    ├── what-is-powerbrain.md       ← Detailed overview and positioning
    ├── deployment.md               ← Dev, prod, TLS, Docker Secrets guide
    ├── architecture.md             ← Technical deep-dive (components, GDPR)
    ├── KNOWN_ISSUES.md             ← Resolved issues archive (P0–P3)
    ├── technology-decisions.md     ← ADRs (VLM, vLLM, Git adapter, OTel)
    ├── scalability.md              ← Scaling, load balancing, caching
    └── gdpr-external-ai-services.md ← Legal assessment for external LLMs

Read the full file on GitHub · 696 lines

Changes

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.

  1. 4d ago First seen · 696 lines · 13,337 tokens per session scan A 51dd51884084

Subscribe to this mod's changes

powerbrain CLAUDE.md is an instructions file published in the GitHub repository nuetzliches/powerbrain (5 stars, last pushed 6d ago), licensed Apache-2.0. It adds 13,337 tokens to every session, about $0.0667 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.