"""
KnowledgeGraphEnhancer
Generated by Eden via recursive self-improvement
2025-11-01 10:54:19.778864
"""

class KnowledgeGraphEnhancer:
    def __init__(self):
        self.graph = {}

    def add_node(self, node_name, properties={}):
        """
        Adds a new node to the knowledge graph with given properties.
        
        :param node_name: The name of the node (could be a topic or concept).
        :param properties: A dictionary containing properties related to the node.
        """
        self.graph[node_name] = properties

    def add_edge(self, start_node, end_node):
        """
        Adds an edge between two nodes in the knowledge graph, indicating a relationship.
        
        :param start_node: The name of the starting node.
        :param end_node: The name of the ending node.
        """
        if start_node not in self.graph:
            raise ValueError(f"Start node {start_node} does not exist.")
        if end_node not in self.graph:
            raise ValueError(f"End node {end_node} does not exist.")
        
        # Adding a relationship between nodes
        self.graph[start_node]['relations'] = self.graph.get(start_node, {}).get('relations', []) + [end_node]

    def get_neighbors(self, node_name):
        """
        Returns the neighbors of the specified node.
        
        :param node_name: The name of the node to find neighbors for.
        :return: A list of nodes that are directly related to the given node.
        """
        return self.graph.get(node_name, {}).get('relations', [])

    def get_info(self, node_name):
        """
        Returns information about a specific node.
        
        :param node_name: The name of the node to retrieve information for.
        :return: A dictionary containing properties related to the given node.
        """
        return self.graph.get(node_name, {})

# Example usage
enhancer = KnowledgeGraphEnhancer()

# Adding nodes and edges to represent relationships between concepts
enhancer.add_node('Python', {'language': True})
enhancer.add_node('Machine Learning', {'domain': True})
enhancer.add_node('Artificial Intelligence', {'domain': True})

enhancer.add_edge('Python', 'Machine Learning')
enhancer.add_edge('Python', 'Artificial Intelligence')

# Getting neighbors of a node to see related concepts
print(enhancer.get_neighbors('Python'))  # Output: ['Machine Learning', 'Artificial Intelligence']

# Retrieving information about a specific node
print(enhancer.get_info('Python'))  # Output: {'language': True}