agentleFS
vicquickvicquick/nobrainr/CLAUDE.md

nobrainr

CLAUDE.md1 starsChanged 9 months agoMITView on GitHub

Provides hybrid search (vector + full-text RRF) by default, context-enriched embeddings, chunked document ingestion with overlapping context, optional cross-encoder reranking, chunk-aware retrieval, automatic entity extraction, on-write dedup, embedding versioning, and a Vue 3 dashboard with interactive graph visualization. The system learns autonomously: it summarizes, consolidates duplicates, synthesizes cross-entity insights, detects contradictions, validates its own extractions, discovers cross-machine patterns, and archives stale knowledge — all on scheduled LLM-powered jobs.

  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use one of these when storing memories — freeform categories are auto-normalized: architecture, debugging, deployment, infrastructure, …

    line 15
  2. Very specific:

    Linking: All chunks share a document_id in metadata with chunk_index and chunk_total

    line 208
  3. Very specific:

    When NOBRAINR_RERANKER_ENABLED=true (default), search overfetches overfetch_mult × limit results per RRF branch and reranks the top …

    line 220
  4. Very specific:

    Every memory mutation is tracked in the memory_versions table.

    line 235
  5. Distinctive:

    Corruption recovery: if an LLM-driven job corrupts a memory, the pre-mutation state is always recoverable

    line 238
  6. Distinctive:

    Snapshot-on-write: Before any mutation, the memory's current state (content, tags, category, confidence, metadata) is captured

    line 253
  7. Very specific:

    Default num_ctx=8192 for all LLM calls (extraction, dedup, distill, documents, search synthesis).

    line 394
  8. Very specific:

    Shared client: All crawl operations go through nobrainr.crawler.client which applies PruningContentFilter by default (80% noise reduction) …

    line 427

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

nobrainr — Collective Agent Memory Service

What This Is

Persistent shared memory for AI coding agents. If you're an agent reading this: you can store learnings with memory_store, search past knowledge with memory_search, and explore the knowledge graph with entity_search / entity_graph. Everything you store is available to every other agent instance connected to this server.

Provides hybrid search (vector + full-text RRF) by default, context-enriched embeddings, chunked document ingestion with overlapping context, optional cross-encoder reranking, chunk-aware retrieval, automatic entity extraction, on-write dedup, embedding versioning, and a Vue 3 dashboard with interactive graph visualization.

Canonical Categories

Use one of these when storing memories — freeform categories are auto-normalized: architecture, debugging, deployment, infrastructure, patterns, tooling, security, frontend, backend, data, business, documentation, session-log, insight, _archived

The system learns autonomously: it summarizes, consolidates duplicates, synthesizes cross-entity insights, detects contradictions, validates its own extractions, discovers cross-machine patterns, and archives stale knowledge — all on scheduled LLM-powered jobs.

Architecture

  • Backend — Python ASGI: FastMCP (HTTP + SSE) + pure JSON API (Starlette)
  • Frontend — Vue 3 + Vuetify + Cytoscape.js (separate container, nginx)
  • PostgreSQL 18 + pgvector — storage, vector similarity, knowledge graph
  • llama-swap (Coolify-deployed) — hosts three on-GPU llama-server processes serving the entire LLM stack from a single container:
    • Main LLM — Qwen3.6-27B-IQ4_XS.gguf (port 5803, 32K ctx, parallel=2, all layers on GPU) handles extraction, chat, scheduler jobs, dedup, synthesis
    • Embeddings — Qwen3-Embedding-0.6B-Q8_0.gguf (port 5802, 4K ctx, all layers on GPU) 1024-dim vectors, OpenAI-compatible /v1/embeddings
    • Reranker — bge-reranker-v2-m3-Q8_0.gguf (port 5800, 4K ctx, all layers on GPU) cross-encoder rerank via llama.cpp /v1/rerank, sigmoid-normalised
  • Crawl4AI — web crawling service (CPU-only container on mcp network, port 11235)

Routing (when using a reverse proxy)

PathTarget
/mcp, /api/*, /sse, /messages/*nobrainr backend (port 8420)
/* (catch-all)dashboard (nginx, port 80)

Project Layout

src/nobrainr/              # Python backend
├── config.py              # Settings via env vars (NOBRAINR_ prefix)
├── cli.py                 # CLI: serve, status, search, extract-backfill, entities, imports
├── db/
│   ├── pool.py            # asyncpg connection pool with pgvector
│   ├── schema.py          # DDL: memories, entities, entity_memories, entity_relations, etc.
│   └── queries.py         # All database operations (memory + entity + graph)
├── services/
│   ├── memory.py          # store_memory_with_extraction(), store_document_chunked()
│   ├── chunking.py        # Text chunking with configurable overlap
│   └── reranker.py        # Cross-encoder reranking via llama-server (bge-reranker-v2-m3, GPU)
├── embeddings/
│   └── ollama.py          # llama-server client (embed_text, embed_batch via /v1/embeddings)
│                          # — name predates the migration; still routes to llama-server on port 5802
├── extraction/
│   ├── models.py          # Pydantic: ExtractedEntity, ExtractedRelationship, ExtractionResult
│   ├── extractor.py       # llama-server /v1/chat/completions with JSON-mode structured output
│   ├── dedup.py           # Memory dedup (vector + LLM merge decision)
│   ├── llm.py             # Shared llama-server chat helper (OpenAI-compatible)
│   └── pipeline.py        # Full pipeline: extract → dedup → store → link
├── crawler/
│   ├── client.py          # Shared Crawl4AI HTTP client (crawl4ai_request, crawl4ai_job, crawl4ai_deep, discover_sitemap_urls, bm25_markdown_generator)
│   ├── pdf.py             # Direct PDF fetch + pymupdf text extraction (bypasses Crawl4AI for PDFs; public hosts only)
│   └── knowledge.py       # Scheduled knowledge crawler (seed URLs, link discovery, freshness, saturation detection)
├── dashboard/
│   ├── app.py             # Parent ASGI app: create_app(), lifespan
│   └── api.py             # Pure JSON API endpoints
├── mcp/
│   └── server.py          # FastMCP server with all MCP tools
├── scheduler.py           # Asyncio periodic task runner (LLM lock, staggered starts)
├── scheduler_jobs.py      # 9 autonomous learning jobs (see Scheduler Jobs section)
└── importers/
    ├── chatgpt.py         # ChatGPT conversations.json parser
    ├── claude.py          # Claude .claude/ directory scanner
    └── documents.py       # Universal document importer (PDF, images, DOCX, text) with vision OCR

dashboard/                  # Vue 3 frontend (separate build)
├── Dockerfile             # node:20-alpine build → nginx:alpine serve
├── nginx.conf             # SPA routing, gzip, cache
├── package.json
├── vite.config.ts
└── src/
    ├── main.ts            # App entry: Vue + Vuetify + Router + Pinia
    ├── App.vue
    ├── api/client.ts      # Axios instance (same-origin)
    ├── plugins/vuetify.ts # Dark theme
    ├── router/index.ts    # /graph, /memories, /timeline, /scheduler
    ├── stores/stats.ts    # Global stats (Pinia)
    ├── types/index.ts     # TypeScript interfaces
    ├── composables/       # useMemories, useGraph, useTimeline, useScheduler
    ├── views/             # GraphView, MemoriesView, TimelineView, SchedulerView
    └── components/        # AppBar, MemoryCard, MemoryDetail, EntityBadge, GraphSidePanel

API Endpoints (pure JSON)

  • /api/graph — Full graph data (Cytoscape elements format)
  • /api/memories — Search/list memories (query: q, category, source_machine, tags, limit, offset)
  • /api/memories/{id} — GET detail (+entities), POST update (JSON body), DELETE
  • /api/timeline — Memories by date (query: category, source_machine, limit, offset)
  • /api/node/{id} — Entity detail + connections + related memories
  • /api/stats — Statistics + feedback
  • /api/scheduler — Scheduler status + events + feedback
  • /api/entities — List entities (query: type, limit, offset)
  • /api/recall — Fast text-only search (PostgreSQL FTS, no embedding)
  • /api/categories, /api/tags — Filter values
  • /api/memories/{id}/history — GET full version audit trail
  • /api/memories/{id}/restore — POST restore to a previous version (body: {"version": N})

MCP Tools

ToolPurpose
memory_storeStore memory with auto-embedding, dedup check, async entity extraction
memory_store_documentStore long documents with chunked ingestion (overlapping chunks, document linking)
memory_searchHybrid search (vector + FTS via RRF) with HyDE, query decomposition, reranking, chunk expansion
memory_queryStructured filter (tags, category, source, machine)
memory_getRetrieve specific memory by ID (tracks access)
memory_updateUpdate memory (re-embeds if content changes, versioned)
memory_deleteDelete a memory (snapshots before deletion)
memory_historyGet full version audit trail for a memory
memory_restoreRestore a memory to a previous version
memory_statsDatabase + knowledge graph + embedding model + chunk statistics
entity_searchSemantic search on knowledge graph entities
entity_graphRecursive graph traversal from a named entity
entity_listList entities with optional type filter
entity_memoriesGet all memories linked to a specific entity
memory_maintenanceRecompute importance + decay stability
memory_extractManually trigger entity extraction for a memory
memory_feedbackReport whether search results were helpful
memory_reflectBatch-save learnings from a session
log_eventRecord significant agent activity
memory_import_chatgptImport ChatGPT export JSON
memory_import_claudeImport Claude memory files
crawl_pageCrawl a URL with PruningContentFilter (or BM25 query-aware filtering), supports css_selector, screenshot, network capture
crawl_and_storeCrawl a URL + chunked ingestion with content filtering (no more truncation, full content preserved)
deep_crawlMulti-page deep crawl (BFS/DFS) with optional store — crawls linked pages from a starting URL
discover_sitemapDiscover page URLs from sitemap.xml and robots.txt for targeted crawling
memory_import_documentsImport documents from a directory (PDF, images, DOCX, markdown) with optional vision OCR
distillCompress text via local LLM — extract only essential info, 90-99% token savings
distill_searchSearch memories + auto-compress results into a focused answer
code_indexIndex a codebase by extracting code symbols (functions, classes, methods) via AST
code_searchSearch indexed code symbols by name/kind — symbol-level retrieval without reading files
community_detectRun Louvain community detection on the knowledge graph with optional LLM summaries
community_listList detected communities with titles, summaries, key topics, top entities
community_membersGet all entities in a specific community
handoff_createCreate structured handoff for next session (task, status, next steps, blockers)
handoff_pickupFind pending handoffs from previous sessions — call on session start
handoff_resolveMark a handoff as completed/superseded/abandoned
memory_set_tierSet a memory's tier (0=pinned, 1=hot, 2=standard, 3=cold)
memory_tier_statsGet memory counts by tier level
error_storeStore structured error pattern (signature, root cause, fix, prevention)
error_searchSearch known error patterns — call before debugging
global_searchGraphRAG global search — map-reduce over community summaries for broad questions
graph_searchEntity-centric graph traversal search — finds entities, walks graph, collects memories

MCP Resources

URIPurpose
nobrainr://briefingSystem stats, top categories, communities, recent events — read on session start
nobrainr://categoriesAll memory categories with counts
nobrainr://machinesConnected machines/agents with memory counts
nobrainr://entity-typesEntity types in the knowledge graph with counts

MCP Prompts

PromptPurpose
session_startStructured workflow for starting a session (search context, log event)
session_endStructured workflow for ending a session (reflect, feedback, store)
debug_investigationStep-by-step debugging workflow (search, entity graph, store fix)
research_topicResearch workflow combining memory search, entities, web crawling

Search & Retrieval Pipeline

query → [optional] LLM query decomposition (2-4 sub-queries)
      → [optional] LLM query expansion (2-3 variants)
          ↓
     embed(each query) → halfvec HNSW index scan (candidates) + FTS keyword search
          ↓                        ↓                                    ↓
     [optional] HyDE       full-precision re-rank              FTS results
     (embed hypothetical         ↓                                    ↓
      answer too)          Reciprocal Rank Fusion (RRF, k=60)
                              ↓
                   cross-encoder reranking (bge-reranker-v2-m3 on GPU, enabled by default)
                              ↓
                   [optional] chunk context expansion (fetch adjacent chunks)
                              ↓
                     final results (with similarity, relevance, rrf_score, tier)
  • Memory tiering — Tier 0 (pinned), 1 (hot), 2 (standard), 3 (cold). Cold memories excluded from search by default (include_cold=True to override). Auto-tiered every 6 hours based on importance + access patterns.
  • Hybrid search is on by default — every memory_search combines vector similarity + full-text matching
  • Embedding model safeguard — search only matches memories embedded with the current model (prevents garbage from mixed embeddings during migration)
  • Context-enriched embeddings — memories are embedded as {category}. {tags}. {content}, not raw text
  • Chunk-aware retrieval — when a search hit is part of a chunked document, adjacent chunks are automatically fetched for context continuity

Chunked Document Ingestion

Long documents (>8000 chars) are automatically split into overlapping chunks:

  • Max chunk size: 6000 chars (configurable: NOBRAINR_CHUNK_MAX_CHARS)
  • Overlap: 500 chars between consecutive chunks (NOBRAINR_CHUNK_OVERLAP_CHARS)
  • Splitting: Prefers paragraph → line → sentence boundaries
  • Linking: All chunks share a document_id in metadata with chunk_index and chunk_total
  • Dedup skipped: Individual chunks skip the write-path dedup check

Used by: memory_store_document, crawl_and_store, memory_import_documents, knowledge crawler.

Embedding Versioning

Each memory and entity tracks which embedding model generated its vector in the embedding_model column. This enables safe model migration via nobrainr re-embed --model <new-model>.

Reranking (optional)

When NOBRAINR_RERANKER_ENABLED=true (default), search overfetches overfetch_mult × limit results per RRF branch and reranks the top reranker_max_candidates with a cross-encoder.

Active backend: bge-reranker-v2-m3 (Q8_0 quant) running as a dedicated llama-server process on the llama-swap container, port 5800, all layers on GPU. Latency ~50ms for 8 candidates at 4K ctx. Backend preference is reranker_backend="http" which hits the llama-server /v1/rerank endpoint; sigmoid-normalises scores to [0,1] so threshold semantics stay stable across model swaps. Falls through to local sentence-transformers (then flashrank ONNX) if the HTTP sidecar is unavailable — keeps search functional during llama-swap redeploys.

Skip-when-dominant: if top-1 RRF score ≥ 2.5× top-2, the reranker is skipped (it can't meaningfully reorder when RRF already has a clear winner). Saves GPU on easy queries.

Memory Versioning (Audit Trail)

Every memory mutation is tracked in the memory_versions table. This provides:

  • Full audit trail: who changed what, when, and why
  • Point-in-time restore: revert any memory to a previous version
  • Corruption recovery: if an LLM-driven job corrupts a memory, the pre-mutation state is always recoverable

What Gets Versioned

Mutationchange_typechanged_by
New memory createdcreatedsystem
Dedup merges new info into existingdedup_updatemcp
Dedup replaces outdated memorydedup_supersedemcp
Manual update via MCP toolmanual_updatemcp
Manual delete via MCP toolmanual_deletemcp
Scheduler consolidation mergeconsolidationscheduler:consolidation
Scheduler auto-summarizeauto_summarizescheduler:auto_summarize
Restore to previous versionrestoremanual

How It Works

  • Snapshot-on-write: Before any mutation, the memory's current state (content, tags, category, confidence, metadata) is captured
  • Version numbers: Sequential per-memory (0 = creation, 1 = first change, etc.)
  • Provenance: source_memory_id and similarity_score track dedup/consolidation origins
  • No data loss: Even deleted memories retain their version history

Client Connection

HTTP transport (recommended — used by Claude Code):

{
  "mcpServers": {
    "nobrainr": {
      "type": "http",
      "url": "https://<your-domain>/mcp"
    }
  }
}

SSE (legacy, still supported):

{
  "mcpServers": {
    "nobrainr": {
      "type": "sse",
      "url": "http://<your-server>:8420/sse"
    }
  }
}

Scheduler Jobs

The scheduler runs 27 autonomous jobs (5 SQL + 2 system + 20 LLM). LLM jobs are serialized via a hardcoded Semaphore(1) — a single GPU cannot handle concurrent gemma3 inference without timeouts. 1s inter-request delay between batch LLM calls for live request coexistence. LLM retry: 5 attempts with exponential backoff on empty/malformed JSON responses. Structured labeling jobs use think=False for ~10x speed.

Knowledge Lifecycle

JobIntervalBatchTypePurpose
chatgpt_distill30m30LLMConvert raw ChatGPT conversations → structured memories (serialized, 1 concurrent)
auto_summarize1h20LLMGenerate 1-line summaries for unsummarized memories
insight_extraction1h30LLMExtract reusable learnings from agent events
consolidation2h10LLMFind near-duplicates (>88% similar) and merge via LLM
entity_enrichment2h20LLMGenerate descriptions for underdescribed entities
synthesis4h5LLMCross-entity insight generation from memory clusters

Web Intelligence (NEW — knowledge crawl evolution)

JobIntervalBatchTypePurpose
knowledge_crawl6h3LLMCrawl seed URLs + queued URLs, store with entity extraction, discover links, saturation detection
entity_web_research12h3LLMFind underdescribed entities, LLM suggests docs URL, crawl + store
freshness_recrawl24h3LLMRe-crawl stale pages (>30 days), update if content changed
interest_expansion24h3LLMResearch hot topics based on agent search/crawl interest signals

Quality & Integrity

JobIntervalBatchTypePurpose
extraction_quality4h20LLMValidate entity extractions, update confidence, prune bad links
contradiction_detection4h10LLMFind semantically similar memories that contradict each other
cross_machine_insights6h5LLMDiscover patterns across different machines/agents

Maintenance

JobIntervalTypePurpose
maintenance6hSQLRecompute importance scores, decay stability
feedback_integration12hSQLAdjust importance based on feedback
memory_decay24hSQLArchive low-value, never-accessed memories >30 days old
auto_tier6hSQLAuto-assign tiers (0-3) based on importance, access patterns, quality
entity_pruning12hSQLPrune noise entities (<=1 memory link, older than 24h)

Self-Improvement (inspired by autoresearch + OpusDelta)

JobIntervalTypePurpose
system_pulse24hLLMGenerate daily health transmission — memory stats, growth, search quality, anomalies
auto_optimize12hLLMAnalyze search feedback patterns, suggest improvements, store optimization insights
community_detection12hLLMLouvain community detection on entity graph + LLM community summaries
cooccurrence_linking4hLLMFind unlinked entity pairs in 3+ shared memories, LLM classifies relationships
github_sync24hLLMIncremental sync of GitHub repository data (requires gh CLI + GH_TOKEN env var)

Knowledge Growth Loop

Agent sessions → interest signals (search queries, manual crawls)
    ↓
interest_expansion (24h) → targeted web research based on hot topics
    ↓
knowledge_crawl (6h) → crawl seed URLs + queued links
    ↓
Link discovery → queue interesting links from crawled pages
    ↓
entity_web_research (12h) → LLM picks underdescribed entities → suggests docs → crawls
    ↓
freshness_recrawl (24h) → re-crawl stale pages → update if changed
    ↓
Knowledge graph grows → entities enriched → new relations discovered

Deployment Notes

LLM Stack (llama-swap on GPU)

The entire inference stack runs as a single Coolify-deployed llama-swap application that supervises three llama-server (llama.cpp) processes pinned to the RTX 4000 SFF Ada (20GB VRAM). Ollama is not used for inference any more — the embeddings/ollama.py filename + a few docstring references are pre-migration leftovers; everything routes through llama-server's OpenAI-compatible endpoints.

RolePortModelQuantctxparalleln-gpu-layers
Main LLM5803Qwen3.6-27B-IQ4_XS.ggufIQ4_XS32768299 (all)
Embeddings5802Qwen3-Embedding-0.6B-Q8_0.ggufQ8_04096—99
Reranker5800bge-reranker-v2-m3-Q8_0.ggufQ8_04096—99

The 27B model carries all language workloads — extraction, dedup, summarization, consolidation, synthesis, scheduler jobs, chat. Config aliases like qwen3.6:35b in config.py (extraction_model, scheduler_llm_model, chat_model) are llama-swap group labels — llama-swap maps the label to whichever physical model is currently loaded on the matching port. Don't expect the label to match the file name; trust the live /v1/models endpoint on port 5803 as ground truth.

VRAM budget: ~18.1 / 20.0 GB in use, ~2.4 GB headroom. All three models stay resident — no swap-out, no keep-alive timer to worry about. Parallel=2 on the 27B lets two concurrent generations share the slot (scheduler batch jobs + a live MCP request can overlap without contention).

Service URL for the nobrainr backend:

NOBRAINR_LLM_SERVER_URL=http://llama-server:8080

The llama-swap router multiplexes the three ports behind that single hostname. The backend uses OpenAI-compatible paths (/v1/chat/completions, /v1/embeddings, /v1/rerank) and chooses the model via the model field, which llama-swap routes to the right llama-server process.

Extraction Performance

  • Main LLM serves chat in non-thinking mode by default (Qwen3.6 supports enable_thinking=true via chat_template_kwargs when explicitly enabled, but extraction/dedup/scheduler all run with enable_thinking=false for ~10× speed and cleaner JSON output).
  • Default num_ctx=8192 for all LLM calls (extraction, dedup, distill, documents, search synthesis). Main LLM is loaded with 32K ctx so longer contexts are available on demand.
  • MAX_CONTENT_CHARS=6000 — content truncation for extraction (matches chunk config).
  • Post-extraction noise filter in pipeline.py catches: short names, generic words, function calls, CLI flags, CSS selectors, trivial file names, resolution strings, git branch names.
  • Qwen3.6-27B IQ4_XS is ~2-3× faster than the previous gemma3:12b stack for structured JSON output and supports a much larger context window without VRAM trouble.
  • Backfill: nobrainr extract-backfill --batch-size 50
  • Retry logic: 5 attempts with exponential backoff on HTTP errors / empty / malformed JSON responses from llama-server.
  • LLM scheduler jobs are serialized via Semaphore(1) (scheduler_llm_concurrency: 5 setting is the upper bound; the actual lock is hardcoded to 1 to prevent concurrent 27B inference from spawning extra slots beyond parallel=2).

Network Aliases (Coolify)

Coolify redeploys create new containers with random suffixes. Traefik routes to stable hostnames (nobrainr, brain-dashboard) via Docker network aliases on the mcp network.

The nobrainr-network.service (systemd) watches docker events and auto-applies aliases when containers restart. No manual post-deploy needed.

# Manual fix if needed:
docker network disconnect mcp <container> && docker network connect --alias nobrainr mcp <container>

Crawl4AI Configuration

  • Container: crawl4ai on mcp network, port 11235 (v0.9.0)
  • CPU only (no GPU), 4GB RAM, 4 CPUs, --shm-size=2g for Chromium
  • Connects to llama-swap via http://llama-server:8080 for LLM-based extraction
  • Env vars: NOBRAINR_CRAWL4AI_URL=http://crawl4ai:11235, NOBRAINR_CRAWL4AI_API_TOKEN
  • Shared client: All crawl operations go through nobrainr.crawler.client which applies PruningContentFilter by default (80% noise reduction) and wraps sync/async/deep crawl APIs
  • API format: v0.8.x requires crawler_config dict wrapping (NOT flat params) to activate content filtering. The shared client handles this automatically.
  • Content filters: PruningContentFilter (default, boilerplate removal) or BM25ContentFilter (query-aware, extracts only relevant sections — used by entity_web_research, interest_expansion)
  • Async job API: Scheduler jobs use POST /crawl/job + polling to avoid HTTP timeouts
  • Deep crawl: BFS/DFS strategies via crawl4ai_deep(), exposed as deep_crawl MCP tool
  • PDFs bypass Crawl4AI (crawler/pdf.py): v0.9.0 fetches a PDF, then fails it as "Blocked by anti-bot protection: Cloudflare JS challenge" (HTTP 500). URLs ending in .pdf are fetched directly; any other URL is probed for a %PDF- body only after its Crawl4AI crawl failed. Text layer via pymupdf → page-separated markdown (## Page N, ---), result in Crawl4AI's shape with metadata.source = "pdf-direct" + page counts. Caps: 50 MB, 500 pages, 1M chars. The direct fetch refuses hosts that resolve to non-public addresses (checked per redirect hop) — internal URLs keep going to Crawl4AI as before. Scanned PDFs return an error pointing at memory_import_documents (vision OCR).
  • v0.9.0 /crawl/job is broken (500 on every request — its metrics middleware crashes on _IncludedRouter). crawl4ai_job() falls back to synchronous /crawl with max_wait as timeout, so the four scheduled crawl jobs work again. deep_crawl has no fallback: /crawl rejects deep-crawl strategies from requests ("may not be constructed from an untrusted request") — it stays down until Crawl4AI is fixed or pinned back.
  • Error dicts: a Crawl4AI HTTP error carries status_code, correlation_id (grep docker logs crawl4ai for the real cause) and, on 5xx, a hint.

TLS Certificates

Uses Traefik letsencrypt-dns resolver (Cloudflare DNS challenge) — works behind VPN where HTTP challenge can't reach port 80. Config: /data/coolify/proxy/dynamic/nobrainr.yaml.

Development

# Backend
uv sync && uv run nobrainr serve

# Frontend (local dev with proxy to backend)
cd dashboard && npm install && npm run dev

# Lint
uv run ruff check src/

# Test
uv run pytest

# flashrank + sentence-transformers stay in deps as fallback paths;
# uv sync installs everything needed.

Configuration Reference (Retrieval)

Env VarDefaultPurpose
NOBRAINR_LLM_SERVER_URLhttp://llama-server:8080llama-swap router (multiplexes 5800/5802/5803)
NOBRAINR_EMBEDDING_MODELqwen3-embedding-cpullama-swap label for the embedding slot (5802)
NOBRAINR_EMBEDDING_DIMENSIONS1024Vector dimensions (must match model — Qwen3-Embed-0.6B = 1024)
NOBRAINR_EXTRACTION_MODELqwen3.6:35bllama-swap label for the main LLM slot (5803, actual file is Qwen3.6-27B-IQ4_XS.gguf)
NOBRAINR_SCHEDULER_LLM_MODELqwen3.6:35bSame slot — scheduler reuses the main LLM
NOBRAINR_CHAT_MODEL(empty → extraction_model)Same slot — chat reuses the main LLM
NOBRAINR_RERANKER_BACKENDhttpReranker backend (http → llama-server 5800; falls back to sentence-transformers then flashrank)
NOBRAINR_RERANKER_URLhttp://reranker:80Override if reranker is on a separate sidecar (default routes via llama-swap path)
NOBRAINR_RERANKER_MODELQwen/Qwen3-Reranker-0.6BSentence-transformers fallback model name (actual GPU process serves bge-reranker-v2-m3)
NOBRAINR_RERANKER_ENABLEDtrueEnable cross-encoder reranking
NOBRAINR_RERANKER_MAX_CANDIDATES8Top-N RRF candidates sent to the cross-encoder
NOBRAINR_CHUNK_MAX_CHARS6000Max characters per chunk
NOBRAINR_CHUNK_OVERLAP_CHARS500Overlap between consecutive chunks
NOBRAINR_CHUNK_THRESHOLD8000Content above this length gets chunked
NOBRAINR_CHUNK_CONTEXT_WINDOW1Adjacent chunks fetched around search hits

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.