UynajGI/drbrain

Academic knowledge graph system — symbol-driven research discovery with lightweight vector retrieval

0

stars

123

commits

Python

primary language

Sep 11, 2026

updated

academic-research
bm25
citation-analysis
cli
graph-embedding
knowledge-extraction
knowledge-graph
llm
paper-management
python
rag
research-tools
Browse cluster: RAG, Knowledge Graphs, and LLM Systems

README

🧠 DrBrain

Symbol-driven academic knowledge graph with corpus-scale hybrid retrieval.

License: MIT Python 3.12+ Version Agent Skills CI

English · 简体中文


Your AI coding agent already reads code and writes code. DrBrain gives it a structured knowledge graph of academic papers — so it can search literature, trace causal chains, find research gaps, and infer new relationships through rule-based reasoning.

  • 📚 Your paper library becomes a queryable knowledge graph with concept-level granularity.
  • 🧩 Reasoning is symbol-driven: closure rules, confidence propagation, counterfactuals — not just embedding similarity.
  • Corpus-scale hybrid retrieval: BM25 + dense vectors + RAPTOR tree summaries + graph traversal, fused by RRF and reranked — over hundreds of thousands of full-text papers, with vectors on semantically-complete tree nodes rather than arbitrary chunks.
  • 🤖 Built for AI agents: every feature is accessible through the CLI that your agent already uses.

✨ Highlights

  • Incremental by default — add one paper to an N-paper library and only that paper builds; closure scans its neighborhood; embeddings micro-adjust.
  • 7 reasoning workflows — review, gap-analysis, impact, compare, frontier, lineage, paradigm.
  • OKF export — emit the entire knowledge graph as an OKF v0.1 markdown bundle that humans and agents can read with cat.
  • 27 agent skills following the open AgentSkills.io standard.

🚀 Quick Start

git clone https://github.com/UynajGI/DrBrain.git
cd DrBrain
uv sync && uv pip install -e .
drbrain setup          # interactive wizard (bilingual EN / 中文)

This creates ~/DrBrain/ as your library root (%USERPROFILE%/DrBrain on Windows).

# Ingest → build → embed → closure (all incremental)
drbrain fetch "10.1038/nature14539"     # grab a paper by DOI
drbrain build                           # 5-stage LLM extraction
drbrain embed                           # TransE graph embeddings
drbrain closure                         # rule-based inference
drbrain ask "What gaps remain in deep learning?"

# Or chain everything at once
drbrain pipeline --preset full

pipx install drbrain and uv tool install drbrain are coming in beta.


📖 What It Does

CategoryFeatureDetails
IngestPDF → structured knowledgeMinerU parsing → 5-source metadata cross-validation (arXiv, CrossRef, S2, OpenAlex, DeepXiv) → LLM tree structuring
Build5-stage concept extraction (incremental)Ontology extension → entity extraction (10-way concurrent) → relation extraction → coreference → iterative refinement
QueryBM25 + graph-enhanced searchKeyword search with multiplicative PageRank boost, directed graph traversal, hybrid ranking
RAG RetrievalLlamaIndex hybrid engineBM25 + vector + tree retrieval fused via RRF, rerank, drbrain hybrid one-shot query, drbrain rag index/eval
Knowledge GraphRule-based closure (incremental)8+4 inference rules, t-norm transitive grounding, TransE embeddings for link prediction
Concept GraphCorpus-scale co-occurrence mapdrbrain cg — concept graph build/embed/neighbors, UMAP map export, leakage-free trend prediction
ReasoningSymbol-driven discoveryCausal chains, confidence propagation, counterfactual analysis, cross-domain isomorphism, hypothesis generation
Workflows7 structured reasoning pipelinesreview, gap-analysis, impact, compare, frontier, lineage, paradigm
SessionsPersistent reasoning contextDB-backed multi-turn sessions, build context injection, cross-invocation continuity
AnalyzeKnowledge frontier reportsResearch seeds, debate zones, technology cliffs, LLM executive summary
CitationsMulti-source expansionForward/backward citations, shared-reference analysis, citation verification
ExportBibTeX, RIS, Markdown + OKF4 citation styles (APA, Vancouver, Chicago, MLA) + OKF v0.1 markdown bundle
ImportZotero, BibTeX, EndnoteWeb API + local SQLite for Zotero, XML/RIS for Endnote
GenealogyConcept lineage + descendantsEvolution trees, academic offspring, paradigm shift detection, cross-domain migration
FetchPDF acquisition from OA sources5-stage fallback (arXiv, OpenAlex, Unpaywall, direct DOI), proxy support
Federated SearchLocal + arXivCross-source search with ingested-status annotation
Patent SearchUSPTO PPUBS + ODPFree (PPUBS) or API-key (ODP) patent search
PipelineStep chaining (incremental)Presets (full/quick/embed) + custom steps; --full forces rebuild
AuditData quality scan15 severity-graded rules, PDF pre-validation, ingest quality gates
All commands

setup ingest ingest-link fetch batch-fetch build embed closure query search hybrid ask reason graph analyze survey evolve landscape frontier paradigm citations check-citations export export-okf import translate session ws cg rag pipeline repair enrich audit backup restore metrics document fsearch patent-search proceedings explore report seed list stats show index queue delete lineage style check clean webui

Run drbrain --help for the full list, or see the CLI Reference.


🤖 Works With Your Agent

Install DrBrain skills so your coding agent can use them:

npx skills add https://github.com/UynajGI/DrBrain/skills

Skills follow the open AgentSkills.io standard and work with Claude Code, Codex, Cline, Cursor, Windsurf, Qwen Code, GitHub Copilot, and other AI coding tools.


⚙️ Configuration

drbrain setup walks you through the basics interactively (bilingual EN / 中文):

  • LLM API key (any litellm provider: OpenAI, Anthropic, Ollama, DeepSeek, …)
  • MinerU token (optional; PyMuPDF fallback for PDF parsing)
  • Semantic Scholar / CrossRef / OpenAlex API keys (optional; higher rate limits)

drbrain check verifies your environment end-to-end. See Configuration for every setting.


📚 Documentation

Getting StartedFrom install to first query
CLI ReferenceAll commands with examples
ArchitectureSystem design and reasoning modules
ConfigurationEvery setting, default, and provider template
WorkflowsStructured reasoning workflow guide
SessionsPersistent Session Agent deep dive
EmbeddingLocal, openai-compat, and none providers
Concept Graph HandoverCorpus-scale concept graph design and status
RAG Current StateLlamaIndex retrieval layer baseline and status
TroubleshootingCommon problems and recovery
Skills Reference27 agent skills and their CLI commands
ContributingHow to add commands, modules, and skills

🙏 Inspired By

DrBrain's agent-first design is inspired by ScholarAIO — the pioneering "research infrastructure for AI agents." DrBrain takes a different technical path: symbol-driven knowledge graph reasoning on top of a corpus-scale hybrid retriever (BM25 + vector + tree + graph, RRF-fused) whose vectors live on semantically-complete tree nodes rather than full-text chunks. Tree-structured retrieval is inspired by PageIndex and RAPTOR.


🤝 Contributing

Contributions are welcome — bug reports, feature requests, docs, and code all help. See CONTRIBUTING.md for the full guide.

Quick start for contributors:

git clone https://github.com/UynajGI/DrBrain.git && cd DrBrain
uv sync && uv pip install -e .
pre-commit install                      # optional: auto-lint on commit
uv run pytest -m "not integration"      # fast tests

Before opening a PR, make sure these pass:

uv run ruff check . && uv run ruff format --check .
uv run mypy src/drbrain
uv run pytest -m "not integration"

We follow Conventional Commits (feat:, fix:, docs:, refactor:, test:, chore:).

Have a question or idea? Open a discussion. Found a bug? File an issue.


📄 License

MIT — see LICENSE.

Contributors

UynajGI

118 commits

UynajGI/drbrain

Academic knowledge graph system — symbol-driven research discovery with lightweight vector retrieval

0

stars

123

commits

Python

primary language

Sep 11, 2026

updated

academic-research
bm25
citation-analysis
cli
graph-embedding
knowledge-extraction
knowledge-graph
llm
paper-management
python
rag
research-tools
Browse cluster: RAG, Knowledge Graphs, and LLM Systems

README

🧠 DrBrain

Symbol-driven academic knowledge graph with corpus-scale hybrid retrieval.

License: MIT Python 3.12+ Version Agent Skills CI

English · 简体中文


Your AI coding agent already reads code and writes code. DrBrain gives it a structured knowledge graph of academic papers — so it can search literature, trace causal chains, find research gaps, and infer new relationships through rule-based reasoning.

  • 📚 Your paper library becomes a queryable knowledge graph with concept-level granularity.
  • 🧩 Reasoning is symbol-driven: closure rules, confidence propagation, counterfactuals — not just embedding similarity.
  • Corpus-scale hybrid retrieval: BM25 + dense vectors + RAPTOR tree summaries + graph traversal, fused by RRF and reranked — over hundreds of thousands of full-text papers, with vectors on semantically-complete tree nodes rather than arbitrary chunks.
  • 🤖 Built for AI agents: every feature is accessible through the CLI that your agent already uses.

✨ Highlights

  • Incremental by default — add one paper to an N-paper library and only that paper builds; closure scans its neighborhood; embeddings micro-adjust.
  • 7 reasoning workflows — review, gap-analysis, impact, compare, frontier, lineage, paradigm.
  • OKF export — emit the entire knowledge graph as an OKF v0.1 markdown bundle that humans and agents can read with cat.
  • 27 agent skills following the open AgentSkills.io standard.

🚀 Quick Start

git clone https://github.com/UynajGI/DrBrain.git
cd DrBrain
uv sync && uv pip install -e .
drbrain setup          # interactive wizard (bilingual EN / 中文)

This creates ~/DrBrain/ as your library root (%USERPROFILE%/DrBrain on Windows).

# Ingest → build → embed → closure (all incremental)
drbrain fetch "10.1038/nature14539"     # grab a paper by DOI
drbrain build                           # 5-stage LLM extraction
drbrain embed                           # TransE graph embeddings
drbrain closure                         # rule-based inference
drbrain ask "What gaps remain in deep learning?"

# Or chain everything at once
drbrain pipeline --preset full

pipx install drbrain and uv tool install drbrain are coming in beta.


📖 What It Does

CategoryFeatureDetails
IngestPDF → structured knowledgeMinerU parsing → 5-source metadata cross-validation (arXiv, CrossRef, S2, OpenAlex, DeepXiv) → LLM tree structuring
Build5-stage concept extraction (incremental)Ontology extension → entity extraction (10-way concurrent) → relation extraction → coreference → iterative refinement
QueryBM25 + graph-enhanced searchKeyword search with multiplicative PageRank boost, directed graph traversal, hybrid ranking
RAG RetrievalLlamaIndex hybrid engineBM25 + vector + tree retrieval fused via RRF, rerank, drbrain hybrid one-shot query, drbrain rag index/eval
Knowledge GraphRule-based closure (incremental)8+4 inference rules, t-norm transitive grounding, TransE embeddings for link prediction
Concept GraphCorpus-scale co-occurrence mapdrbrain cg — concept graph build/embed/neighbors, UMAP map export, leakage-free trend prediction
ReasoningSymbol-driven discoveryCausal chains, confidence propagation, counterfactual analysis, cross-domain isomorphism, hypothesis generation
Workflows7 structured reasoning pipelinesreview, gap-analysis, impact, compare, frontier, lineage, paradigm
SessionsPersistent reasoning contextDB-backed multi-turn sessions, build context injection, cross-invocation continuity
AnalyzeKnowledge frontier reportsResearch seeds, debate zones, technology cliffs, LLM executive summary
CitationsMulti-source expansionForward/backward citations, shared-reference analysis, citation verification
ExportBibTeX, RIS, Markdown + OKF4 citation styles (APA, Vancouver, Chicago, MLA) + OKF v0.1 markdown bundle
ImportZotero, BibTeX, EndnoteWeb API + local SQLite for Zotero, XML/RIS for Endnote
GenealogyConcept lineage + descendantsEvolution trees, academic offspring, paradigm shift detection, cross-domain migration
FetchPDF acquisition from OA sources5-stage fallback (arXiv, OpenAlex, Unpaywall, direct DOI), proxy support
Federated SearchLocal + arXivCross-source search with ingested-status annotation
Patent SearchUSPTO PPUBS + ODPFree (PPUBS) or API-key (ODP) patent search
PipelineStep chaining (incremental)Presets (full/quick/embed) + custom steps; --full forces rebuild
AuditData quality scan15 severity-graded rules, PDF pre-validation, ingest quality gates
All commands

setup ingest ingest-link fetch batch-fetch build embed closure query search hybrid ask reason graph analyze survey evolve landscape frontier paradigm citations check-citations export export-okf import translate session ws cg rag pipeline repair enrich audit backup restore metrics document fsearch patent-search proceedings explore report seed list stats show index queue delete lineage style check clean webui

Run drbrain --help for the full list, or see the CLI Reference.


🤖 Works With Your Agent

Install DrBrain skills so your coding agent can use them:

npx skills add https://github.com/UynajGI/DrBrain/skills

Skills follow the open AgentSkills.io standard and work with Claude Code, Codex, Cline, Cursor, Windsurf, Qwen Code, GitHub Copilot, and other AI coding tools.


⚙️ Configuration

drbrain setup walks you through the basics interactively (bilingual EN / 中文):

  • LLM API key (any litellm provider: OpenAI, Anthropic, Ollama, DeepSeek, …)
  • MinerU token (optional; PyMuPDF fallback for PDF parsing)
  • Semantic Scholar / CrossRef / OpenAlex API keys (optional; higher rate limits)

drbrain check verifies your environment end-to-end. See Configuration for every setting.


📚 Documentation

Getting StartedFrom install to first query
CLI ReferenceAll commands with examples
ArchitectureSystem design and reasoning modules
ConfigurationEvery setting, default, and provider template
WorkflowsStructured reasoning workflow guide
SessionsPersistent Session Agent deep dive
EmbeddingLocal, openai-compat, and none providers
Concept Graph HandoverCorpus-scale concept graph design and status
RAG Current StateLlamaIndex retrieval layer baseline and status
TroubleshootingCommon problems and recovery
Skills Reference27 agent skills and their CLI commands
ContributingHow to add commands, modules, and skills

🙏 Inspired By

DrBrain's agent-first design is inspired by ScholarAIO — the pioneering "research infrastructure for AI agents." DrBrain takes a different technical path: symbol-driven knowledge graph reasoning on top of a corpus-scale hybrid retriever (BM25 + vector + tree + graph, RRF-fused) whose vectors live on semantically-complete tree nodes rather than full-text chunks. Tree-structured retrieval is inspired by PageIndex and RAPTOR.


🤝 Contributing

Contributions are welcome — bug reports, feature requests, docs, and code all help. See CONTRIBUTING.md for the full guide.

Quick start for contributors:

git clone https://github.com/UynajGI/DrBrain.git && cd DrBrain
uv sync && uv pip install -e .
pre-commit install                      # optional: auto-lint on commit
uv run pytest -m "not integration"      # fast tests

Before opening a PR, make sure these pass:

uv run ruff check . && uv run ruff format --check .
uv run mypy src/drbrain
uv run pytest -m "not integration"

We follow Conventional Commits (feat:, fix:, docs:, refactor:, test:, chore:).

Have a question or idea? Open a discussion. Found a bug? File an issue.


📄 License

MIT — see LICENSE.

Contributors

UynajGI

118 commits

Languages

Python

98.9%