# AGI Capability - Attempt 1
# Created: 2025-10-24 17:14:43.120192

class MetaCognitiveAgent:
    def __init__(self):
        self.knowledge_base = {} # A dictionary to store knowledge base
        self.thoughts = []       # A list to record thoughts for introspection
        
    def learn(self, new_information: str) -> None:
        # The agent learns and updates its knowledge base with the new information. 
        self.knowledge_base[new_information] = True
    
    def think(self, problem: str) -> str:
        # The agent uses reasoning to solve a given problem based on its knowledge base.
        solution = f"I've solved {problem} by using the following knowledge from my base: " + ', '.join([k for k in self.knowledge_base])
        
        # Record this thought process for future introspection and improvement
        self.thoughts.append(solution)
        
        return solution
    
    def meta_cognition(self, problem: str) -> None:
        # The agent reflects on its own thinking about a given problem to improve itself. 
        if not self.thoughts:
            print("I have no thoughts recorded yet.")
            return
        
        for thought in selfe.thoughts:
            if problem in thought:
                # Identify areas of weakness and focus on improving them
                area_of_weakness = thought[problem].split(' ')[0] + " is a potential area to improve."
                
                print(area_of_weakness)  # Output the identified area for improvement.
        
        self.thoughts = []  # Clear thoughts after introspection and learning from them.