Skip to main content
Glama

cognitive_patterns

Analyze cognitive patterns and problem-solving approaches to identify optimal thinking conditions and strategies for improved decision-making.

Instructions

    Analyze cognitive patterns and problem-solving approaches.
    Answers: 'When do I think best?' with data.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNo

Implementation Reference

  • The tool 'cognitive_patterns' analyzes and reports on cognitive patterns, problem-solving approaches, emotional tones, and breakthrough insights, optionally filtered by domain.
    def cognitive_patterns(domain: str = None) -> str:
        """
        Analyze cognitive patterns and problem-solving approaches.
        Answers: 'When do I think best?' with data.
        """
        db = get_summaries_db()
        if db:
            if domain:
                rows = db.execute("""
                    SELECT cognitive_pattern, problem_solving_approach, importance,
                           emotional_tone, thinking_stage, content_category
                    FROM summaries WHERE domain_primary = ?
                """, [domain]).fetchall()
            else:
                rows = db.execute("""
                    SELECT cognitive_pattern, problem_solving_approach, importance,
                           emotional_tone, thinking_stage, content_category
                    FROM summaries
                """).fetchall()
    
            if not rows:
                return f"No data found{f' for domain: {domain}' if domain else ''}"
    
            cols = [
                "cognitive_pattern", "problem_solving_approach", "importance",
                "emotional_tone", "thinking_stage", "content_category",
            ]
    
            pattern_counts, approach_counts, tone_counts = {}, {}, {}
            bt_patterns, bt_approaches, bt_tones = {}, {}, {}
            category_counts = {}
            total, bt_total = len(rows), 0
    
            for row in rows:
                r = dict(zip(cols, row))
                p = r["cognitive_pattern"] or ""
                if p:
                    pattern_counts[p] = pattern_counts.get(p, 0) + 1
                a = r["problem_solving_approach"] or ""
                if a:
                    approach_counts[a] = approach_counts.get(a, 0) + 1
                t = r["emotional_tone"] or ""
                if t:
                    tone_counts[t] = tone_counts.get(t, 0) + 1
                cat = r["content_category"] or ""
                if cat:
                    category_counts[cat] = category_counts.get(cat, 0) + 1
                if r["importance"] == "breakthrough":
                    bt_total += 1
                    if p:
                        bt_patterns[p] = bt_patterns.get(p, 0) + 1
                    if a:
                        bt_approaches[a] = bt_approaches.get(a, 0) + 1
                    if t:
                        bt_tones[t] = bt_tones.get(t, 0) + 1
    
            output = [f"## 🧬 Cognitive Patterns{f' ({domain})' if domain else ''}\n"]
            output.append(f"_Analyzed {total} conversations ({bt_total} breakthroughs)_\n")
    
            output.append(f"### Cognitive Patterns")
            for p, c in sorted(pattern_counts.items(), key=lambda x: -x[1])[:10]:
                bt = bt_patterns.get(p, 0)
                bt_mark = f" (πŸ’ŽΓ—{bt})" if bt else ""
                output.append(f"  {p}: {c} ({c/total*100:.0f}%){bt_mark}")
    
            output.append(f"\n### Problem Solving Approaches")
            for a, c in sorted(approach_counts.items(), key=lambda x: -x[1])[:10]:
                bt = bt_approaches.get(a, 0)
                bt_mark = f" (πŸ’ŽΓ—{bt})" if bt else ""
                output.append(f"  {a}: {c} ({c/total*100:.0f}%){bt_mark}")
    
            output.append(f"\n### Emotional Tones")
            for t, c in sorted(tone_counts.items(), key=lambda x: -x[1])[:8]:
                bt = bt_tones.get(t, 0)
                bt_mark = f" (πŸ’ŽΓ—{bt})" if bt else ""
                output.append(f"  {t}: {c}{bt_mark}")
    
            if category_counts:
                output.append(f"\n### Content Categories")
                for cat, c in sorted(category_counts.items(), key=lambda x: -x[1])[:8]:
                    output.append(f"  {cat}: {c}")
    
            if bt_patterns:
                top_bt = max(bt_patterns, key=bt_patterns.get)
                output.append(f"\n### πŸ’Ž Breakthrough Insight")
                output.append(f"Your breakthroughs most associate with **{top_bt}** thinking")
                if bt_tones:
                    top_tone = max(bt_tones, key=bt_tones.get)
                    output.append(f"and tend to happen when you're in a **{top_tone}** emotional state.")
    
            return "\n".join(output)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mordechaipotash/brain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server