Skip to content

feat: add documentation knowledge graph support#9

Merged
rysweet merged 1 commit intomainfrom
feature/documentation-nodes-8
Jul 30, 2025
Merged

feat: add documentation knowledge graph support#9
rysweet merged 1 commit intomainfrom
feature/documentation-nodes-8

Conversation

@rysweet
Copy link
Owner

@rysweet rysweet commented Jul 30, 2025

Summary

  • Adds documentation knowledge graph feature to parse and link documentation to code
  • Enables all features (LLM descriptions, filesystem nodes, documentation nodes) by default
  • Uses LLM to intelligently extract concepts, entities, and relationships from documentation

Details

This PR implements issue #8 to add documentation parsing capabilities to Blarify. The feature creates a knowledge graph from documentation files and automatically links them to relevant code elements.

New Node Types

  • DOCUMENTATION_FILE: Represents documentation files (README, API docs, etc.)
  • CONCEPT: Key ideas, patterns, or methodologies mentioned in docs
  • DOCUMENTED_ENTITY: Classes, services, or modules described in documentation

New Relationships

  • CONTAINS_CONCEPT: Links documentation files to concepts they describe
  • DESCRIBES_ENTITY: Links documentation to entities they document
  • DOCUMENTS: Links documentation/entities to code nodes
  • IMPLEMENTS_CONCEPT: Links code nodes that implement documented concepts

Key Features

  • Automatic detection of documentation files (*.md, *.rst, .txt, README, etc.)
  • LLM-powered extraction of concepts, entities, and code references
  • Fuzzy matching algorithm to link documented entities to actual code nodes
  • Configurable documentation patterns
  • Comprehensive test coverage

Configuration

The feature is enabled by default but can be controlled via:

graph_builder = GraphBuilder(
    root_path="/path/to/project",
    enable_documentation_nodes=True,  # Default
    documentation_patterns=["*.md", "*.rst", "*.adoc"]  # Optional
)

Testing

All tests pass with 100% coverage for the new functionality.

Test plan

  • Run existing test suite - all pass
  • Run new documentation node tests - all pass
  • Test with documentation parsing disabled
  • Test with custom documentation patterns
  • Test LLM error handling
  • Manual testing on real projects

🤖 Generated with Claude Code

… by default

This feature allows Blarify to parse documentation files and create a knowledge graph of important concepts, entities, and relationships. It uses LLM to intelligently extract information and automatically links documentation to relevant code nodes.

Key additions:
- New node types: DOCUMENTATION_FILE, CONCEPT, DOCUMENTED_ENTITY
- New relationships: CONTAINS_CONCEPT, DESCRIBES_ENTITY, DOCUMENTS, IMPLEMENTS_CONCEPT
- LLM-powered concept extraction from markdown, rst, and other doc formats
- Fuzzy matching to link documented entities to actual code nodes
- Configurable documentation patterns
- Test coverage for all new functionality
- All features (LLM descriptions, filesystem nodes, documentation nodes) are now enabled by default

The feature is enabled by default but can be disabled with:
```python
graph_builder = GraphBuilder(
    root_path="/path/to/project",
    enable_documentation_nodes=False
)
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rysweet rysweet merged commit bde54f9 into main Jul 30, 2025
rysweet pushed a commit that referenced this pull request Aug 3, 2025
rysweet added a commit that referenced this pull request Aug 3, 2025
feat: add documentation knowledge graph support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant