Skip to content

anubissbe/knowledgehub-vscode-extension

Repository files navigation

KnowledgeHub AI Intelligence - VS Code Extension

Transform your AI development tools with persistent memory, learning, and project context.

🚀 What This Extension Does

This extension bridges any AI tool (GitHub Copilot, Claude Dev, Cline, etc.) with KnowledgeHub AI Intelligence, giving them:

  • 🧠 Persistent Memory: Remembers everything across sessions
  • 📚 Project Context: Understands your codebase patterns and decisions
  • 🎯 Learning Intelligence: Learns from mistakes and improves over time
  • 🔗 Session Continuity: Picks up exactly where you left off
  • ⚡ Performance Optimization: Uses learned patterns for better suggestions

🎯 Supported AI Tools

Automatically Enhanced:

  • GitHub Copilot (Claude 4, GPT-4.1, etc.)
  • Continue/Cline - AI coding assistant
  • Claude Dev - Anthropic's VS Code extension
  • Codeium - Free AI code completion
  • TabNine - AI code completion
  • AWS CodeWhisperer - Amazon's AI assistant

Generic Support:

  • Any AI extension that provides code completion or chat

🔧 Features

Memory & Context

  • Session Continuity: AI remembers previous conversations and decisions
  • Project-Aware: Understands your specific codebase and patterns
  • Cross-Session Learning: Learns from mistakes and successes
  • Decision Tracking: Remembers why architectural choices were made

AI Enhancement

  • Context Injection: Automatically adds relevant project context to AI requests
  • Pattern Recognition: Uses learned patterns for better suggestions
  • Error Prevention: Warns about issues based on past experience
  • Performance Optimization: Learns optimal approaches for your projects

Real-Time Intelligence

  • Live Context Tracking: Monitors your coding activity in real-time
  • Predictive Assistance: Suggests next steps based on patterns
  • Smart Completions: Enhanced code completions with project awareness
  • Learning Dashboard: View AI insights and learning progress

🚀 Quick Start

1. Prerequisites

  • VS Code 1.80.0 or later
  • KnowledgeHub server running (see setup guide)

2. Installation

# Clone the repository
git clone <repository-url>
cd knowledgehub-vscode-extension

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Package extension (optional)
vsce package

3. Configuration

Open VS Code settings and configure:

{
  "knowledgehub.server.url": "http://192.168.1.25:3000",
  "knowledgehub.ai.autoEnhance": true,
  "knowledgehub.ai.primaryProvider": "auto",
  "knowledgehub.ai.enhancementLevel": "maximum"
}

4. First Use

  1. Open Command Palette (Ctrl+Shift+P)
  2. Run KnowledgeHub: Initialize AI Session
  3. Your AI tools are now enhanced!

🎮 Commands

Command Description
KnowledgeHub: Initialize AI Session Start enhanced AI session
KnowledgeHub: Show AI Dashboard Open AI insights dashboard
KnowledgeHub: Analyze Project Context Analyze current project
KnowledgeHub: Show Memory Context View AI memory and history
KnowledgeHub: Enable AI Enhancement Toggle AI enhancement on/off

⚙️ Configuration

Basic Settings

{
  // KnowledgeHub server URL
  "knowledgehub.server.url": "http://192.168.1.25:3000",
  
  // Automatically enhance AI requests
  "knowledgehub.ai.autoEnhance": true,
  
  // Primary AI provider to enhance
  "knowledgehub.ai.primaryProvider": "auto", // or "github_copilot", "cline", etc.
  
  // Level of context enhancement
  "knowledgehub.ai.enhancementLevel": "maximum" // "minimal", "standard", "maximum"
}

Advanced Settings

{
  // Track code changes for learning
  "knowledgehub.memory.trackChanges": true,
  
  // Context compression ratio for small models
  "knowledgehub.context.compressionRatio": 10,
  
  // UI preferences
  "knowledgehub.ui.hasShownWelcome": false
}

🔍 How It Works

Before Enhancement:

You: "Create user authentication"
AI: [Generic auth code with no project context]

After KnowledgeHub Enhancement:

You: "Create user authentication"

AI gets enhanced context:
- Your project uses JWT with 15min expiry (learned from past decisions)
- Follows existing error handling patterns
- Integrates with your existing user service
- Uses your team's preferred validation approach

AI: [Perfect code that fits your project perfectly]

🧠 AI Intelligence Features

1. Session Continuity

  • Remembers conversations across VS Code restarts
  • Maintains context between different projects
  • Links related work sessions automatically

2. Learning Intelligence

  • Learns from your coding patterns and preferences
  • Remembers solutions to problems you've encountered
  • Adapts suggestions based on what works in your projects

3. Project Intelligence

  • Understands your codebase architecture and patterns
  • Tracks decisions and their rationale
  • Suggests improvements based on project history

4. Performance Intelligence

  • Optimizes AI requests based on learned patterns
  • Compresses context for faster responses
  • Routes requests to optimal AI providers

📊 Dashboard

Access the AI Dashboard to view:

  • Memory Statistics: What the AI has learned
  • Pattern Recognition: Identified code patterns
  • Decision History: Past architectural choices
  • Performance Metrics: AI effectiveness stats
  • Learning Progress: Continuous improvement tracking

🔧 Development

Building the Extension

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch for changes
npm run watch

# Package for distribution
vsce package

Testing

# Run extension in development mode
F5 (in VS Code)

# Test with different AI providers
# Enable GitHub Copilot, Cline, etc. and test enhancement

🤝 Integration Examples

GitHub Copilot Enhanced

When you use Copilot, you get:

  • Project context automatically injected
  • Learned patterns applied to suggestions
  • Past decisions considered in code generation
  • Error prevention based on experience

Cline/Continue Enhanced

When you chat with Cline, it knows:

  • Full project history and context
  • Previous conversations and solutions
  • Code patterns you prefer
  • Architectural decisions and rationale

Claude Dev Enhanced

Claude Dev gets enhanced with:

  • Memory of past interactions
  • Project understanding from KnowledgeHub
  • Pattern recognition for better suggestions
  • Learning from successful outcomes

🌐 Network Architecture

VS Code Extension
       ↓
KnowledgeHub AI (192.168.1.25:3000)
       ↓
13 MCP Services (192.168.1.24:3001-3015)

The extension works with the distributed KnowledgeHub infrastructure to provide intelligent AI enhancement.

🚨 Troubleshooting

Extension Not Activating

# Check KnowledgeHub server connection
curl http://192.168.1.25:3000/health

# Verify VS Code version
code --version

# Check extension logs
View → Output → KnowledgeHub AI

AI Enhancement Not Working

  1. Check AI provider is installed and active
  2. Verify knowledgehub.ai.autoEnhance is enabled
  3. Initialize AI session: Ctrl+Shift+PKnowledgeHub: Initialize AI Session

Context Not Loading

  1. Check KnowledgeHub server is running
  2. Verify workspace folder is open
  3. Check network connectivity to 192.168.1.25

📈 Performance

  • Minimal Latency: <200ms context enhancement
  • Efficient Memory: Uses smart caching and compression
  • Scalable: Handles large codebases with context compression
  • Reliable: Fallback modes ensure continuous operation

🔒 Security

  • No Code Transmission: Only metadata and context sent to KnowledgeHub
  • Local Processing: AI enhancement happens locally when possible
  • Secure Storage: All data encrypted and stored securely
  • Privacy-First: No data sent to external services without consent

🎯 Roadmap

Version 1.1

  • Real-time code analysis and suggestions
  • Advanced pattern recognition
  • Multi-language context understanding

Version 1.2

  • Team collaboration features
  • Advanced AI routing and optimization
  • Custom AI provider support

Version 2.0

  • Natural language interface
  • Predictive code generation
  • Advanced learning algorithms

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📞 Support


Transform your AI development tools with memory, learning, and context! 🚀

About

VS Code extension that enhances AI tools with persistent memory, learning, and project context

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published