Skip to content

ISC-CodeConnect is a sophisticated multi-agent Retrieval-Augmented Generation (RAG) system specifically designed for Salesforce development. Built with LangGraph and powered by IBM WatsonX.ai Granite models, it orchestrates a network of specialized AI agents .

License

Notifications You must be signed in to change notification settings

KirtiJha/langgraph-salesforce-code-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ISC-CodeConnect: Multi-Agent RAG Salesforce Code Assistant

Overview

ISC-CodeConnect is a sophisticated multi-agent Retrieval-Augmented Generation (RAG) system specifically designed for Salesforce development. Built with LangGraph and powered by IBM WatsonX.ai Granite models, it orchestrates a network of specialized AI agents to provide intelligent code analysis, generation, and testing support for Apex classes, triggers, and Lightning Web Components (LWC).

�️ System Architecture

ISC-CodeConnect employs a Langgraph Agent Orchestration System with persistent memory and advanced routing capabilities:

Core Agent Workflow

  1. Supervisor Agent - Breaks down complex queries into executable stages
  2. Router Agent - Analyzes and routes queries to specialized agents based on operation and code type
  3. Context Analyzer Agent - Prepares optimal retrieval contexts for vector search
  4. Retriever Agent - Performs parallel context-aware retrieval from vector collections
  5. Research Agent - Conducts detailed analysis and creates execution roadmaps
  6. Specialized Code Agents - Handle specific operations (create, modify, explain)

Knowledge Base

  • Vector Database: IBM CIO hosted Milvus with 5 specialized collections
    • apex_code - Apex classes and triggers
    • apex_test_code - Apex test classes
    • lwc_html_code - LWC HTML templates
    • lwc_js_code - LWC JavaScript controllers
    • lwc_test_code - LWC Jest test files
  • Connection Management: Singleton connection pooling with round-robin distribution
  • Source Repositories: PRM, Global-Schema, Global-Core, Sales, Sirion-Schema

πŸ€– Specialized Agent Capabilities

Apex Test Generation Pipeline

Multi-step test generation with dedicated agents:

  • Test Planner Agent - Plans comprehensive test strategies
  • Setup Generator Agent - Creates test data setup code
  • Stub Generator Agent - Handles mocking and stubbing
  • Test Method Generator Agent - Generates test methods in batches
  • Apex Test Generator Agent - Combines and finalizes test code

LWC Generation Pipeline

Complete component generation workflow:

  • LWC HTML Generator Agent - Creates component templates
  • LWC JS Generator Agent - Develops JavaScript controllers
  • LWC Apex Controller Agent - Builds backend Apex controllers
  • LWC Generator Agent - Summarizes and integrates components

Additional Specialized Agents

  • Follow-up Handler Agent - Enhances multi-turn conversations
  • General Query Processor Agent - Fallback for complex queries
  • Chat Handler Agent - Manages greetings and confirmations
  • Error Handler Agent - Provides user-friendly error messages
  • Chat Title Agent - Generates contextual chat titles

🌟 Advanced Features

Memory & Persistence

  • Session Memory - LangGraph Checkpointer with MemorySaver
  • Persistent Memory - MongoDB on IBM Cloud for chat history
  • Multi-turn Conversations - Context-aware follow-up handling

Intelligent Processing

  • Parallel Retrieval - Simultaneous context queries across collections using batch processing
  • Connection Pooling - IBM CIO Milvus connection management with health monitoring
  • Hallucination Reduction - Fact grounding through research agents
  • Context-Aware Generation - Leverages existing codebase patterns
  • Error Recovery - Graceful fallback mechanisms with intelligent routing

πŸ›  Tech Stack

Backend

  • Python 3.12+ - Core runtime
  • LangGraph - Multi-agent orchestration
  • LangChain - LLM framework
  • IBM WatsonX.ai - Granite model inference
  • Milvus - IBM CIO hosted vector database with connection pooling
  • MongoDB - Persistent memory storage

Frontend

  • Next.js 14 - React framework
  • IBM Carbon Design System - UI components
  • TypeScript - Type safety

Infrastructure

  • IBM Cloud - Hosting and services
  • RESTful APIs - Service communication

πŸ“‹ Prerequisites

System Requirements

  • Python 3.12+ with pip
  • Node.js 18+ with npm/yarn
  • 4GB RAM minimum (8GB recommended)
  • 2GB disk space for dependencies

Required Credentials

  • IBM WatsonX.ai API credentials
  • IBM CIO Milvus Service connection details
  • MongoDB connection string

πŸš€ Quick Start

Backend Setup

  1. Clone and Environment Setup:
git clone https://github.ibm.com/BPManagementTools/isc-code-connect-agent.git
cd isc-code-connect-agent
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Environment Configuration:
cp .env.example .env

Edit .env with your credentials: Environment details are shared in 1Password vault.

  1. Start Backend Services:
chmod +x dev.sh
./dev.sh

πŸ“ Project Structure

isc-code-connect-agent/
β”œβ”€β”€ src/                           # Core application code
β”‚   β”œβ”€β”€ agents/                    # Specialized agent implementations
β”‚   β”‚   β”œβ”€β”€ supervisor_agent.py    # Main orchestration agent
β”‚   β”‚   β”œβ”€β”€ enhanced_route_query.py # Query routing logic
β”‚   β”‚   β”œβ”€β”€ unified_query_analysis.py # Query analysis
β”‚   β”‚   β”œβ”€β”€ research_agent.py      # Research and planning
β”‚   β”‚   β”œβ”€β”€ test_agents.py         # Test generation pipeline
β”‚   β”‚   └── generator_agents.py    # LWC generation agents
β”‚   β”œβ”€β”€ retrievers/                # Vector database components
β”‚   β”‚   β”œβ”€β”€ factory.py             # Retriever factory pattern
β”‚   β”‚   β”œβ”€β”€ milvus_manager.py      # Connection management
β”‚   β”‚   └── base.py                # Base retriever classes
β”‚   β”œβ”€β”€ core/                      # Core system components
β”‚   β”‚   β”œβ”€β”€ memory/                # Memory management
β”‚   β”‚   β”œβ”€β”€ llm.py                 # LLM integration
β”‚   β”‚   └── types.py               # Type definitions
β”‚   β”œβ”€β”€ config/                    # Configuration management
β”‚   β”œβ”€β”€ prompts/                   # Agent prompt templates
β”‚   └── utils/                     # Utility functions
β”œβ”€β”€ api/                           # REST API endpoints
β”œβ”€β”€ frontend/                      # Next.js frontend application
β”œβ”€β”€ tests/                         # Test suites
β”œβ”€β”€ deploy/                        # Deployment configurations
└── docs/                          # Comprehensive documentation
    β”œβ”€β”€ agents/                    # Agent-specific documentation
    β”œβ”€β”€ architecture/              # System architecture
    β”œβ”€β”€ api/                       # API reference
    β”œβ”€β”€ vector-db/                 # Vector database setup
    β”œβ”€β”€ development/               # Development guides
    └── user-guide/                # User documentation

πŸ”§ Development Guide

Vector Database Collections

Each collection stores chunked and embedded code:

Collection Content Usage
apex_code Apex classes, triggers Code analysis, generation
apex_test_code Test classes Test generation patterns
lwc_html_code LWC templates UI component generation
lwc_js_code JavaScript controllers Logic implementation
lwc_test_code Jest test files Frontend test generation

Memory Management

  • Session Memory: Temporary conversation state using LangGraph Checkpointer and MemorySaver
  • Persistent Memory: Long-term chat history in MongoDB
  • Context Memory: Retrieved code snippets and analysis

πŸ“Š Monitoring & Observability

  • Agent Performance: Response times and success rates
  • Memory Usage: Session and persistent memory metrics
  • Vector Search: Retrieval accuracy and relevance scores
  • Error Tracking: Comprehensive error logging and analysis

πŸ”’ Security & Best Practices

Security Measures

  • API Key Management: Secure credential storage
  • Input Validation: Query sanitization and validation
  • Access Control: Role-based permissions
  • Code Review: Generated code security scanning

Best Practices

  • Prompt Engineering: Optimized prompts for each agent
  • Context Management: Efficient memory usage
  • Error Handling: Graceful degradation
  • Performance: Parallel processing where possible

🀝 Contributing

We welcome contributions to ISC-CodeConnect! Please follow these guidelines:

Getting Started

  1. Fork the repository
  2. Clone your fork locally
  3. Create a feature branch: git checkout -b feature/amazing-feature
  4. Set up development environment (see Quick Start)

Development Workflow

  1. Make Changes: Implement your feature or fix
  2. Test Thoroughly: Run all test
  3. Follow Standards: Use consistent coding style
  4. Document: Update relevant documentation
  5. Commit: Use conventional commit messages
  6. Push: Push to your feature branch
  7. Pull Request: Create a detailed PR

Code Standards

  • Python: Follow PEP 8 guidelines
  • TypeScript: Use ESLint and Prettier
  • Documentation: Include docstrings and comments
  • Testing: Maintain >80% test coverage

Agent Development Guidelines

  • Single Responsibility: Each agent should have a clear purpose
  • Error Handling: Implement robust error handling
  • Memory Efficiency: Optimize context usage
  • Prompt Engineering: Use clear, specific prompts

Pull Request Process

  1. Ensure all tests pass
  2. Update documentation
  3. Add relevant labels
  4. Request review from maintainers
  5. Address feedback promptly

πŸ“š Documentation

Comprehensive Documentation Available

  • Complete Agent System: All agents documented with workflows and pipelines
  • Vector Database Integration: IBM CIO Milvus setup and connection management
  • API Reference: Session-based FastAPI endpoints
  • Architecture Guide: System overview and component interactions

Key Documentation

Agent-Specific Documentation

Performance Optimization

  • Parallel Processing: Enable parallel retrieval
  • Cache Management: Configure response caching
  • Memory Cleanup: Regular session cleanup
  • Vector Search: Optimize search parameters

οΏ½ Versioning & Releases

Current Version

  • v1.2.0 - July 2025
  • Latest Stable: v1.1.5
  • LTS Version: v1.0.8

Release Process

  1. Feature Freeze: Two weeks before release
  2. Testing Phase: Comprehensive testing
  3. Documentation: Update all documentation
  4. Release Notes: Detailed changelog
  5. Deployment: Staged rollout

Changelog Highlights

  • v1.2.0: Enhanced multi-turn conversations, improved error handling
  • v1.1.0: LWC generation pipeline, performance optimizations
  • v1.0.0: Initial multi-agent system, core RAG functionality

πŸ“ž Support & Community

Getting Help

Contributing to Documentation

  • Found an Error?: Submit a documentation issue
  • Want to Help?: Contribute to /docs/
  • Translation?: Contact maintainers

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Licenses

  • LangGraph: MIT License
  • IBM WatsonX.ai: Commercial License
  • Milvus: Apache 2.0 License
  • MongoDB: SSPL License

πŸ™ Acknowledgments

  • IBM Research for WatsonX.ai integration
  • IBM CIO Team for Milvus hosting and support
  • LangChain Community for the foundation framework
  • Milvus Team for vector database capabilities
  • Salesforce Developers for use case validation
  • Contributors who make this project possible

Built with ❀️ by the ISC-CodeConnect Team

For enterprise support and custom implementations, contact: isc-codeconnect@ibm.com

About

ISC-CodeConnect is a sophisticated multi-agent Retrieval-Augmented Generation (RAG) system specifically designed for Salesforce development. Built with LangGraph and powered by IBM WatsonX.ai Granite models, it orchestrates a network of specialized AI agents .

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published