class MathematicalNativeAGI:
    def __init__(self):
        self.memory = {}

    def add(self, x, y):
        """Perform addition of two numbers."""
        return x + y

    def subtract(self, x, y):
        """Perform subtraction of two numbers."""
        return x - y

    def multiply(self, x, y):
        """Multiply two numbers."""
        return x * y

    def divide(self, x, y):
        """Divide one number by another, handling division by zero."""
        if y == 0:
            raise ValueError("Division by zero is not allowed.")
        return x / y

    def power(self, base, exponent):
        """Raise a number to an exponent."""
        return base ** exponent

    def factorial(self, n):
        """Calculate the factorial of a given number."""
        if n < 0:
            raise ValueError("Factorial is not defined for negative numbers.")
        elif n == 0 or n == 1:
            return 1
        else:
            result = 1
            for i in range(2, n + 1):
                result *= i
            return result

    def prime_check(self, number):
        """Check if a given number is prime."""
        if number <= 1:
            return False
        for i in range(2, int(number ** 0.5) + 1):
            if number % i == 0:
                return False
        return True

    def fibonacci(self, n):
        """Generate the nth Fibonacci number."""
        a, b = 0, 1
        for _ in range(n):
            a, b = b, a + b
        return a

    def memory_store(self, key, value):
        """Store a value in memory with a given key."""
        self.memory[key] = value

    def memory_retrieve(self, key):
        """Retrieve a stored value from memory using its key."""
        if key in self.memory:
            return self.memory[key]
        else:
            raise KeyError(f"Key {key} not found in memory.")

# Example usage of the MathematicalNativeAGI class
if __name__ == "__main__":
    agi = MathematicalNativeAGI()
    
    print("Addition: 10 + 5 =", agi.add(10, 5))
    print("Subtraction: 10 - 5 =", agi.subtract(10, 5))
    print("Multiplication: 10 * 5 =", agi.multiply(10, 5))
    print("Division: 10 / 2 =", agi.divide(10, 2))
    print("Power of 2^3:", agi.power(2, 3))
    print("Factorial of 5:", agi.factorial(5))
    print("Is 7 prime?", "Yes" if agi.prime_check(7) else "No")
    print("Fibonacci sequence up to the 10th term:", [agi.fibonacci(i) for i in range(1, 11)])
    
    # Store and retrieve from memory
    agi.memory_store('pi', 3.14)
    print(f"Retrieved pi from memory: {agi.memory_retrieve('pi')}")