๐Ÿงช

11ku7-ai

Research Team Based in India

Exploring AI-assisted development tools, authentication systems, and code analysis technologies.

๐Ÿ‡ฎ๐Ÿ‡ณ India ๐Ÿค– AI Research ๐Ÿ’ป Open Source

Current Project

๐Ÿš€

11ku7-ai-nodecoder

AI Coding Tool For Hobbyists & Researchers

An autonomous AI developer with Agent Mode, MCP integration, GitHub support, and 22+ customizable themes. Generate, edit, and deploy code directly from your terminal.

View Project โ†’

Learnings & Outcomes

๐Ÿ› ๏ธ Technology Stack

Node.js

Runtime

Express.js

Web Framework

MongoDB

Database

JWT

Authentication

Socket.IO

Real-time Comm

Neo-Blessed

Terminal UI

Marked

Markdown Parser

Highlight.js

Syntax Highlighting

AI Providers: OpenRouter, Gemini, OpenAI, Anthropic, Grok, Groq, Ollama

๐Ÿ” Device Locking Mechanism

We implemented a secure device-locking system that ties contribution keys to specific devices, preventing unauthorized sharing while maintaining a smooth user experience.

How It Works:

  1. Device Fingerprint: Generate unique device identifier using hardware characteristics
  2. Login Identifier: Store device-username binding in MongoDB collection
  3. Token Validation: Each request validates both JWT token and device fingerprint
  4. Single Device Lock: One active login per user - switching devices requires logout

๐ŸŽซ JWT Authentication

Implemented secure stateless authentication using JSON Web Tokens with automatic expiry handling and session management.

Token Features

  • 30-days expiry for contribution keys
  • 2-hour expiry for community keys
  • Automatic background validation
  • Secure key storage in .env

Security Measures

  • Bcrypt password hashing
  • Rate limiting (express-rate-limit)
  • CORS protection
  • Server-side session revocation

๐Ÿ”ฎ Holograph - Universal Code Analysis Engine

Our most innovative creation - the Holographic Lexer provides language-agnostic code analysis with intelligent symbol tracking and type inference.

Core Components

  • UniversalLexer: Polyglot tokenizer
  • FlowGraph: Symbol graph builder
  • Diagnostics: Unused/undefined detection
  • Linker: Cross-file resolution

Supported Languages

  • JavaScript / TypeScript
  • Python
  • Java / C / C++
  • Go / Rust / Ruby

Key Innovations:

  • ๐Ÿ“Š Heap-based Symbol Tracking: Every definition gets a unique heap ID for refactoring
  • ๐Ÿ”— Type Inference: Automatically detects types from constructors, assignments, and return values
  • ๐Ÿ“ JSDoc Parsing: Extracts @param, @returns, @type annotations
  • ๐ŸŽฏ Scope Boundary Detection: Tracks function/class boundaries for context-aware analysis
  • ๐Ÿ Indentation Languages: Special handling for Python/YAML via virtual brace injection

๐Ÿง  ReAct Agent Architecture

The core of our Agent Mode - a ReAct (Reasoning + Acting) loop that enables autonomous task completion with intelligent decision-making.

Agent Loop Cycle:

  1. Observe: Gather context from project structure, memory, and external sources
  2. Think: Generate reasoning about the current state and next action
  3. Act: Execute a tool (file edit, shell command, search, etc.)
  4. Reflect: Evaluate result and update memory for next iteration

Key Features

  • Up to 500 autonomous steps in Auto Mode
  • Persistent session memory across turns
  • Efficiency protocol to prevent redundant actions
  • Scrutiny system for human-like decision making

Memory System

  • Hot memory: Active session cache
  • Persistent memory: Cross-session archival
  • Memory hydration from past turns
  • Relevant file detection from history

๐Ÿ”Œ MCP (Model Context Protocol) Integration

Extend the agent's capabilities by connecting to external MCP servers for specialized tools and knowledge bases.

MCPClientManager

  • Multi-server connection management
  • StdioClientTransport for local servers
  • Auto server selection based on query
  • Generic tool invocation via schema

Capabilities

  • Memory persistence (store/retrieve)
  • External API access
  • Custom tool definitions
  • JSON schema argument building

Config: ~/.nodecoder/mcp-servers.json | SDK: @modelcontextprotocol/sdk

๐Ÿ“„ PDF Vision Pipeline

A unique approach to PDF understanding - convert PDF pages to high-quality images and leverage vision models for analysis.

Pipeline Flow:

  1. PDF Attachment: User attaches PDF via /browse command
  2. Page Conversion: pdftoppm renders pages at 300 DPI with anti-aliasing
  3. Vision Analysis: Agent uses read_pdf_page_visual tool to request specific pages
  4. AI Interpretation: Vision model extracts text, diagrams, tables from image

Technical Details

  • Uses poppler-utils (pdftoppm)
  • 300 DPI high-quality rendering
  • Anti-aliasing enabled (-aa yes)
  • Supports multi-page PDFs

Why Vision over OCR?

  • Preserves layout and structure
  • Understands diagrams and charts
  • Handles complex formatting
  • No OCR library dependencies

๐Ÿ” Web Search Integration

Real-time web access for up-to-date information, documentation, and code examples.

Brave Search API

  • Privacy-focused search provider
  • Configurable result count
  • Returns title, URL, and snippets
  • 15-second timeout protection

Smart Search Routing

  • Auto-classifies query type
  • Routes to Exa MCP for code/docs
  • Falls back to Brave for general
  • Deep vs quick search modes

๐Ÿ› ๏ธ Core Agent Tools

A comprehensive toolset enabling the agent to understand, navigate, and modify codebases autonomously.

๐Ÿ“ File Navigation

  • get_file_dependencies
  • load_file_full
  • apply_change_interactive
  • generate_edit_plan

๐Ÿ”Ž Symbol Analysis

  • find_symbol_definition
  • find_symbol_references
  • holograph_diagnostics
  • parallel_explore

โšก Execution

  • execute_shell
  • agent_terminal (persistent)
  • web_search / smart_search
  • read_pdf_page_visual

๐Ÿ™ GitHub Integration

  • github_explore_repo
  • github_create_branch
  • github_create_pr
  • github_sync_changes

๐Ÿ’ฌ Interaction

  • ask_user (consent prompts)
  • general_chat
  • provide_code_analysis
  • task_complete

๐Ÿงฉ Extensibility

  • Custom tools via agent.config.json
  • MCP server tools
  • Tool filtering by context
  • Dynamic tool registry

๐Ÿ–ฅ๏ธ Cross-Platform PTY Terminal

A dual-implementation persistent terminal system that provides true pseudo-terminal (PTY) capabilities across platforms, enabling the agent to run interactive shell sessions.

๐Ÿง Linux/macOS (Python PTY)

  • Uses Python's pty module for Unix PTY
  • Spawns shell via pty.spawn()
  • Full terminal emulation (bash/zsh)
  • Signal forwarding (Ctrl+C โ†’ SIGINT)
  • Works on Termux (Android) natively

๐ŸชŸ Windows (node-pty)

  • Uses node-pty native addon
  • Spawns PowerShell with no profile loading
  • ConPTY integration for true Windows PTY
  • Custom prompt suppression for clean output
  • ANSI escape code stripping

Key Architecture Decisions:

  • ๐Ÿ”„ Persistent Sessions: Terminal stays alive across multiple agent tool calls, preserving environment variables and working directory
  • ๐Ÿ“Š Output Buffering: Ring buffer collects output with configurable timeouts and completion detection via exit code markers
  • ๐Ÿงน Smart Cleanup: ANSI escape sequences and control characters stripped from output before feeding back to AI
  • โฑ๏ธ Timeout Protection: Configurable command timeouts (30s default) with automatic process interruption

๐ŸŒ Headless WebUI Mode

A full web-based interface that runs without any terminal TUI, enabling remote access from browsers and mobile devices via Socket.IO real-time communication.

WebUI Features

  • IDE-style layout with file explorer
  • Monaco editor for file editing
  • Real-time chat with markdown rendering
  • Status bar with all TUI controls
  • Mobile-responsive design

Architecture

  • Express + Socket.IO server
  • Automatic setup wizard for auth
  • Gateway token for remote security
  • Cloudflare tunnel support built-in
  • TUI โ†” WebUI shared state bridge

๐Ÿ”ฌ Diff Validation Engine

A multi-pass validation system that catches AI code generation errors before applying changes, using holographic analysis and structural validation.

Validation Passes

  • Structural syntax validation
  • Holographic scope analysis
  • Search/Replace match verification
  • Context-aware error recovery

Error Prevention

  • Catches duplicate inserts
  • Detects missing context lines
  • Validates bracket/brace balance
  • Auto-retry with AI guidance

๐Ÿงฉ Agent Skill System

A modular skill system that lets the agent load specialized capabilities on demand, extending its knowledge without bloating the base context.

How It Works

  • Skills defined as markdown files
  • Auto-discovered from skills/ directory
  • Toggle ON/OFF per session
  • Injected into agent system prompt

Benefits

  • Reduces base context token usage
  • User-configurable expertise areas
  • Hot-reloadable without restart
  • WebUI toggle via skills modal

๐Ÿ“ฑ Telegram Bot Integration

Full Telegram bot interface that mirrors the terminal experience, enabling mobile-first AI coding from any device with Telegram installed.

Features

  • Complete command system (/agent, /chat, /cwd)
  • Inline keyboard buttons for consent
  • File upload/download support
  • Real-time typing indicators

Technical

  • node-telegram-bot-api integration
  • Markdown/HTML message formatting
  • Rate limiting and owner-only access
  • Seamless state sharing with TUI

๐Ÿ”— Remote Access & Tunneling

Built-in support for accessing the agent remotely via secure tunnels, enabling development from any location without complex network configuration.

  • ๐Ÿ›ก๏ธ Gateway Tokens: Secure token-based authentication for remote WebUI connections
  • โ˜๏ธ Cloudflare Tunnel: Auto-provisions cloudflared quick tunnels for public HTTPS URLs
  • ๐ŸŒ Zero-Config Remote: Single env var (REMOTE=true TUNNEL=true) enables full remote setup
  • ๐Ÿ”’ Auth Middleware: Socket.IO middleware validates tokens before allowing connection

๐ŸŽจ Theming System

22+ built-in themes with a modular theme engine that controls colors across the entire TUI and WebUI simultaneously.

Theme Categories

  • Game-inspired (Cyberpunk, Zelda, Mario)
  • IDE-style (Monokai, Dracula, Solarized)
  • Nature-themed (Ocean, Forest, Sunset)
  • Custom user-defined themes

Implementation

  • Theme JSON with accent/bg/border colors
  • Runtime theme switching via /theme
  • Logo color auto-adaptation
  • WebUI CSS variable synchronization

๐Ÿ’ฐ Community Funding Model

We developed a sustainable dual-key funding system that balances accessibility with ongoing development support.

๐Ÿ”‘ Community Keys

  • Free 2-hour universal access
  • Unlocked when funding goal reached
  • Available to everyone

๐Ÿ—๏ธ Contribution Keys

  • 30-day personal access
  • Device-locked security
  • Supports ongoing development