Skip to content

ifsvivek/Symbiote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧬 Symbiote

Your Code. Your Style. Your AI Shadow.

Symbiote is an intelligent, adaptive coding assistant that learns how you codeβ€”and then becomes your snarky, ever-evolving sidekick. It observes, remembers, critiques (sometimes too honestly), and writes code in your exact style, almost like your second brain... if your second brain had better linting skills.

Powered by LangGraph, LangChain, LLaMA 3.3, and Gemini API, Symbiote builds a personal graph of your habits, quirks, and coding rituals to deliver personalized suggestions, witty corrections, and hauntingly familiar code snippets.


✨ Features

  • 🧠 Intelligent Memory System (FAISS + Google GenAI) Persistent pattern learning that remembers your coding style across sessions
  • πŸ”„ LangGraph Multi-Agent Workflows Dynamic orchestration with intelligent agent routing and state management
  • πŸ€– AI-Powered Interactive Chat Chat with your codebase using LLaMA 3.3 orchestration and Gemini code generation
  • πŸ” Deep Code Analysis (Python AST) Advanced code structure analysis, complexity metrics, and pattern detection
  • πŸ› οΈ Intelligent Tool System Advanced tool calling with parallel execution and rich context
  • 🧩 Multi-Language Code Parsing Supports Python, JavaScript, TypeScript, Java, C++, Go, Rust, and more
  • πŸ“Š Persistent Pattern Memory FAISS vector store with Google GenAI embeddings for intelligent code suggestions
  • πŸ’¬ Sass-Enabled Feedback Modeβ„’ Adjustable snark levels (0-10) for entertaining code reviews and commentary
  • πŸ“š Context-Aware Code Generation Gemini-powered generation that learns and adapts to your exact coding style
  • πŸ” Intelligent Project Analysis AI-powered analysis of your entire codebase structure and patterns
  • 🦾 Real-Time Workflow Execution LangGraph workflows for complex multi-step coding tasks

πŸš€ Enhanced Features

Symbiote implements advanced functionality with your complete tech stack:

🧠 Intelligent Memory System (FAISS + Google GenAI)

  • Persistent Pattern Learning: Learns from your coding patterns and stores them in FAISS vector database
  • Style Recognition: Analyzes and remembers your coding style preferences
  • Context-Aware Suggestions: Provides suggestions based on similar past patterns
  • Cross-Session Memory: Patterns persist across sessions and projects

πŸ”„ LangGraph Workflows

  • Multi-Agent Orchestration: Intelligent routing between LLaMA and Gemini agents
  • State Management: Maintains conversation context and workflow state
  • Parallel Tool Execution: Execute multiple tools simultaneously for efficiency
  • Error Recovery: Automatic fallback and error handling in workflows

πŸ” Deep Code Analysis (Python AST)

  • Structural Analysis: Extract classes, functions, imports, and variables
  • Complexity Metrics: Calculate cyclomatic complexity and maintainability index
  • Pattern Detection: Identify design patterns, code smells, and best practices
  • Quality Assessment: Automated code quality scoring and recommendations

⚑ Enhanced Tool System

  • Standard Tool Calling: OpenAI/Anthropic compatible tool call format
  • Multi-Turn Conversations: Proper conversation flow with tool results
  • Async Tool Execution: Non-blocking tool operations
  • Rich Tool Registry: File ops, git management, shell execution, code search, AST analysis

🎯 Intelligent Interactions

  • Contextual Understanding: Understands project structure and codebase
  • Intelligent Code Generation: Generates code that matches your style
  • Proactive Analysis: Automatically suggests improvements and patterns
  • Learning from Feedback: Improves responses based on your interactions

πŸ—οΈ Advanced Architecture

Symbiote uses a sophisticated multi-agent system with full tech stack integration:

  • 🧠 LangGraph Workflow Orchestrator

    • Manages complex multi-agent interactions with state management
    • Intelligent routing between agents based on task requirements
    • Parallel tool execution and error recovery
    • Advanced conversation flows
  • 🦾 LLaMA 3.3 Agent (Orchestrator)

    • Handles user input, intent detection, and tool selection
    • Uses standard OpenAI/Anthropic tool calling format
    • Manages multi-turn conversations with proper context
    • Integrates with FAISS memory for pattern-aware responses
  • πŸ’Ž Gemini Agent (Code Specialist)

    • Receives enhanced context from LLaMA and memory patterns
    • Generates code that matches learned user patterns
    • Performs deep code analysis and refactoring
    • Returns structured responses with explanations
  • πŸ› οΈ Enhanced Tool System

    • File operations with intelligent caching
    • Git management with smart suggestions
    • Shell execution with safety checks
    • AST-based code analysis and pattern extraction
    • Vector memory search and pattern retrieval
  • 🧠 FAISS Vector Memory

    • Stores coding patterns with Google GenAI embeddings
    • Learns from user interactions and code generations
    • Provides context-aware suggestions
    • Persists knowledge across sessions
  • πŸ“‘ Communication

    • Agents communicate via structured LangChain messages
    • LangGraph manages workflow state and routing
    • Memory integration provides enhanced context
    • Advanced tool result processing

🚦 Enhanced Workflow

  1. User makes a request (code generation, analysis, file operations, etc.)
  2. LangGraph Workflow analyzes intent and retrieves relevant patterns from FAISS memory
  3. Intelligent Routing determines optimal agent and tool combination
  4. Parallel Tool Execution gathers context (files, git status, code analysis)
  5. Memory-Enhanced Processing incorporates learned patterns and user preferences
  6. LLaMA Agent orchestrates the response with proper tool calling
  7. Gemini Agent generates contextual code matching user's style
  8. Pattern Learning stores successful interactions for future use
  9. Structured Response delivered with proper formatting and explanations

Enhanced Workflow Features:

  • Context Awareness: Automatically understands project structure
  • Pattern Matching: Uses FAISS to find similar past solutions
  • Style Consistency: Maintains your coding style across generations
  • Multi-Turn Memory: Remembers conversation context and tool results
  • Error Recovery: Intelligent fallback and retry mechanisms

πŸ› οΈ Tool Handling System

  • Modular tool registry for easy extension.
  • Tools for file operations, git, shell, search, and more.
  • LLaMA can chain tool calls and handle tool outputs.
  • Error handling, logging, and extensibility for new tools.

🎯 Advanced Features

Pattern Learning & Memory

  • Persistent Vector Storage: FAISS-based pattern memory that persists across sessions
  • Multi-Language Support: Analyzes Python, JavaScript, TypeScript, Java, C++, Go, Rust
  • Style Preference Detection: Learns naming conventions, indentation, API usage patterns
  • Architectural Pattern Recognition: Identifies design patterns and code organization preferences

Interactive Chat Mode

  • File Operations: Read, modify, and create files through natural language
  • Terminal Integration: Execute shell commands directly from chat
  • Context-Aware Assistance: Understands your entire codebase for better suggestions
  • Git Integration: Analyze diffs, commits, and repository history

AI-Powered Code Analysis

  • LangGraph Workflows: Multi-agent analysis pipelines for comprehensive insights
  • Complexity Metrics: Function complexity, code quality assessment
  • Documentation Analysis: Comment patterns and documentation preferences
  • Import/Dependency Mapping: Understanding of your library and framework usage

Sass Modeβ„’

Adjustable personality levels (0-10 scale):

  • 0-3: Professional and helpful
  • 4-6: Friendly with occasional humor
  • 7-8: Sarcastic but constructive
  • 9-10: Full tsundere mode (use at your own risk! 😀)

Personality is fully adjustable! Use the /sass <level> command, config file, or CLI flag to set your preferred sass level. All agents (LLaMA and Gemini) will adapt their tone and style accordingly for every interaction.


πŸ§ͺ Future Features

Planned Enhancements

  • VSCode Extension: Integrated IDE experience with real-time suggestions
  • GitHub App: Automated PR commenting and code review workflows
  • Visual Style Dashboard: Interactive graph visualization of your coding patterns
  • Team Mode: Multi-developer style blending and team preference learning
  • Custom Model Support: Integration with local LLMs and other AI providers
  • Code Refactoring Agent: Automated code improvement suggestions
  • Documentation Generator: Auto-generate docs matching your writing style

Experimental Ideas

  • "Clone Me" Mode: Train a model to write code exactly like you
  • Code Archaeology: Deep analysis of coding evolution over time
  • Style Conflict Resolution: Help teams reconcile different coding preferences
  • Smart Code Templates: Generate boilerplate matching your exact patterns

πŸ”„ Recent Enhancements: Advanced Tool Calling

Symbiote has been enhanced with modern tool calling patterns for improved reliability and standardization:

✨ Key Improvements

  • πŸ”§ Standard Tool Calling: Uses OpenAI/Anthropic compatible tool calling format instead of custom JSON
  • πŸ’¬ Multi-Turn Conversations: Proper conversation flow with tool results integrated into context
  • ⚑ Parallel Tool Execution: Execute multiple tools simultaneously for better performance
  • πŸ›‘οΈ Enhanced Error Handling: Structured error responses with proper tool result tracking
  • πŸ“š Better Tool Definitions: LangChain StructuredTool integration with proper schemas
  • πŸ”„ Conversation Memory: Maintains conversation history with tool interactions for context

πŸ†š Before vs After

Aspect Old Implementation Enhanced Implementation
Tool Format Custom JSON parsing Standard tool_calls objects
Conversation Single-turn Multi-turn with history
Tool Execution Sequential Parallel execution
Error Handling Basic try/catch Structured tool_result objects
Integration Custom parser LangChain tool binding

🧰 Tech Stack

  • LangGraph β€” Dynamic multi-agent workflows for code analysis
  • LangChain β€” Agent orchestration, memory management & tool integration
  • LLaMA 3.3 β€” Orchestration, tool use, and workflow management
  • Gemini API β€” Advanced code understanding, generation & intelligent insights
  • FAISS β€” Vector storage for persistent pattern memory
  • Google GenAI β€” Embeddings and natural language processing
  • Python AST β€” Deep code structure analysis and pattern extraction

πŸ“¦ Requirements

See requirements.txt for all dependencies. Core stack includes:

  • langgraph, langchain, langchain-community, langchain-core, langchain-google-genai
  • google-genai, faiss-cpu, httpx
  • pydantic, typing-extensions, python-dotenv, pathlib, dataclasses-json

πŸš€ Quick Start

  1. Clone and setup:

    git clone <your-repo>
    cd Symbiote
    python -m venv .venv
    source .venv/bin/activate  # Linux/Mac
    # or .venv\Scripts\activate  # Windows
    pip install -r requirements.txt
  2. Set up API keys:

    cp .env.example .env
    # Edit .env and add your API keys:
    # GROQ_API_KEY=your_groq_api_key_here
    # GOOGLE_API_KEY=your_google_api_key_here
  3. Run Symbiote:

    python main.py
  4. Start coding with your AI assistant!

    🧬 You: create a hello world function
    πŸ€– Symbiote: *generates clean Python code*
    
    🧬 You: /sass 8
    πŸ€– Symbiote: Fine, I'll be more sarcastic... 😏
    

πŸ‘¨β€πŸ’» Author

Made by Vivek Sharma β€” the type of dev whose AI assistant may become too powerful.


πŸ“ License

MIT β€” Use it, break it, improve it, sass it. Just don't sell it as your symbiote. 😀

About

Your Code. Your Style. Your AI Shadow.

Topics

Resources

License

Stars

Watchers

Forks

Languages