Skip to content

RikaiDev/cortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

46 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Cortex AI

Version License Node.js

English | ็น้ซ”ไธญๆ–‡ | Documentation | Updates | Changelog

๐Ÿง  AI Collaboration Brain

Cortex AI is an AI collaboration system that transforms AI models into intelligent, learning partners. It solves the core problem of AI inconsistency and lack of memory through prompt injection and real-time preference learning.

๐ŸŽฏ Why Cortex?

The Problem:

  • AI models lack stable thinking processes (Chain-of-Thought)
  • AI forgets user preferences and repeats the same mistakes
  • Different AI platforms behave inconsistently
  • No personalization or learning from conversation

The Solution:

  • ๐Ÿง  Brain - Structured thinking through prompt injection
  • ๐Ÿ“š Experience - Real-time learning from user feedback
  • ๐Ÿ”„ Evolution - Continuous improvement without repeating mistakes

๐Ÿ—๏ธ Architecture

๐Ÿง  Brain (MDC/GEMINI/CLAUDE)
โ”œโ”€โ”€ Real-time thinking and decision making
โ”œโ”€โ”€ Structured 5-step thinking process
โ”œโ”€โ”€ User preference learning from conversation
โ””โ”€โ”€ Cross-platform consistency

๐Ÿ“š Experience (docs)
โ”œโ”€โ”€ Long-term memory and knowledge base
โ”œโ”€โ”€ Project-specific patterns and conventions
โ”œโ”€โ”€ Learning from successful interactions
โ””โ”€โ”€ Continuous knowledge evolution

๐Ÿ› ๏ธ Essential Tools
โ”œโ”€โ”€ Prompt injection for AI enhancement
โ”œโ”€โ”€ User preference detection and application
โ”œโ”€โ”€ Cross-platform adapter system
โ””โ”€โ”€ Simplified CLI for core operations

Cortex Philosophy

Cortex AI represents our core philosophy for transforming AI interactions:

  1. Few-Shot to Fine-Tune Transformation - We transform simple few-shot examples into comprehensive fine-tune prompts automatically, eliminating the need for manual prompt engineering.

  2. Hook-Based Interception System - Our architecture intercepts all user inputs and processes them through a structured pipeline that guarantees consistent quality and behavior.

  3. Deterministic Expansion Over Randomness - Rather than relying on emergent behaviors, we systematically expand minimal user inputs into complete, well-structured instructions.

  4. Guaranteed Processing Pipeline - Every user input is processed through our complete pipeline with 100% execution rate, ensuring no step is ever skipped.

  5. Explicit Reasoning and Documentation - All transformations from few-shot to fine-tune are explicit, documented, and traceable through our workflow.

This philosophy drives our implementation of an intelligent system that transforms simple user inputs (few-shot examples) into comprehensive, production-ready fine-tune prompts through mandatory processing steps.

MCP Workflow Architecture

graph TD
    A[User Input] --> B[Cursor Processing]
    B --> C{MCP Interceptor}
    C -->|Enforced Execution| D[MCP Workflow]
    D --> E[Intent Analysis]
    E --> F[Task Decomposition]
    F --> G[Role Selection]
    G --> H[Best Practice Search]
    H --> I[Instruction Generation]
    I --> J[User Response]

    subgraph "MCP Enforcement Mechanism"
    C
    K[.cursor/rules/cortex.mdc]
    L[prompt-injection.ts]
    M[thought-interceptor.ts]
    end

    K --> C
    L --> C
    M --> C
Loading

MCP Processing Sequence

sequenceDiagram
    participant User as User
    participant Cursor as Cursor AI
    participant Rules as .cursor/rules/cortex.mdc
    participant Interceptor as Thought Interceptor
    participant MCP as MCP Workflow
    participant Tools as MCP Tools

    User->>Cursor: Input Message
    Cursor->>Rules: Load Rules
    Rules->>Cursor: Enforce MCP Rules
    Cursor->>Interceptor: Intercept User Input
    Interceptor->>MCP: Force MCP Workflow Execution
    MCP->>Tools: Execute Intent Analysis
    Tools->>MCP: Return Intent Results
    MCP->>Tools: Execute Task Decomposition
    Tools->>MCP: Return Task Structure
    MCP->>Tools: Execute Role Selection
    Tools->>MCP: Return Role Assignments
    MCP->>Interceptor: Return Complete MCP Results
    Interceptor->>Cursor: Inject Structured Thinking
    Cursor->>User: Return MCP-Based Response
Loading

โœจ Core Features

๐Ÿง  Structured Thinking

  • 6-Step Thinking Process: Intent Exploration โ†’ Problem Analysis โ†’ Knowledge Integration โ†’ Solution Development โ†’ Implementation Planning โ†’ Quality Validation
  • Mandatory Protocol: Forces AI to think systematically, regardless of model capabilities
  • Quality Validation: Ensures complete and logical thinking

๐Ÿ“š Real-Time Learning

  • User Preference Detection: Learns from keywords like "ไธๅฐ", "ๆˆ‘ๅ€‘็”จ", "ไธ่ฆ"
  • Immediate Application: Applies learned preferences to current response
  • No Repetition: Never repeats corrected mistakes
  • Frustration Detection: Recognizes and learns from user frustration

๐Ÿ”„ Cross-Platform Consistency

  • Cursor Integration: Enhanced MDC with preference learning
  • Claude Support: Context-aware system messages
  • Gemini Support: Platform-specific prompt engineering
  • Unified Behavior: Same learning and thinking across all platforms

๐Ÿš€ Quick Start

Installation

# Global installation
npm install -g @rikaidev/cortex

# Or using npx
npx @rikaidev/cortex

Initialize Project

# Initialize Cortex AI in your project
cortex init

# Generate IDE configurations
cortex generate-ide

Start Learning

# Start AI collaboration
cortex start

# Show version
cortex version

๐ŸŽฏ How It Works

1. Learning from Conversation

User: "่จป่งฃๅˆ้–‹ๅง‹ๅฏซไธญๆ–‡ไบ†๏ผŸ"
AI: [Learns] Write all comments in English
User: "ๆˆ‘ๅ€‘็”จ uv run pytest"
AI: [Learns] Always use uv run for Python commands
User: "ๅˆไพ†ไบ†"
AI: [Learns] Don't repeat the same mistake

2. Structured Thinking

๐Ÿ” ANALYSIS PHASE: [Problem understanding]
๐Ÿ“š KNOWLEDGE INTEGRATION: [Apply learned preferences]
๐Ÿ’ก SOLUTION DEVELOPMENT: [Consider user preferences]
โšก IMPLEMENTATION PLAN: [Respect user patterns]
โœ… QUALITY VALIDATION: [Ensure preference compliance]

3. Cross-Platform Consistency

  • Same learning across Cursor, Claude, and Gemini
  • Same thinking process on all platforms
  • Same preferences applied everywhere
  • Same evolution through conversation

๐Ÿ“š Documentation

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 18+
  • TypeScript knowledge

Setup

# Clone repository
git clone https://github.com/RikaiDev/cortex.git
cd cortex

# Install dependencies
npm install

# Build project
npm run build

# Run tests
npm run test

# Start development
npm run dev

Contributing

๐ŸŽฏ Why "Cortex"?

Cortex (ๅคง่…ฆ็šฎ่ณช) represents the brain's advanced cognitive functions:

  • ๐Ÿง  Thinking - Structured reasoning and problem-solving
  • ๐Ÿ“š Memory - Learning and storing experiences
  • ๐Ÿ”„ Evolution - Continuous improvement through experience
  • ๐ŸŽฏ Decision - Making informed choices based on learning

Just like the human cerebral cortex, Cortex AI is the "brain" for AI systems - responsible for thinking, memory, learning, and decision-making.


Transform your AI interactions from frustrating repetitions to intelligent, learning partnerships with Cortex AI.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published