CRAB Contextual Retrieval And Analysis Bot banner
jmanhype jmanhype

CRAB Contextual Retrieval And Analysis Bot

AI community

Description

CRAB (Contextual Retrieval and Analysis Bot) is an AI-powered chatbot using Retrieval-Augmented Generation. It features state machine-driven conversation, file system operations, and flexible search modes. CRAB integrates ChromaDB for efficient retrieval and LangSmith for monitoring, offering intelligent responses and analysis.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

CRAB: Contextual Retrieval and Analysis Bot

CRAB (Contextual Retrieval and Analysis Bot) is a sophisticated AI-powered conversational system that combines Retrieval-Augmented Generation (RAG), state machine-based conversation flow, and various AI tools to provide intelligent responses and perform file system operations.

Features

  • RAG-based question answering using local documents and optional web search
  • State machine-driven conversation flow
  • File system operations (list directory, change directory, read files)
  • Flexible mode switching between standard and web search
  • Integration with ChromaDB for efficient document retrieval
  • Sentence embedding for semantic search
  • Logging and error handling
  • Integration with LangSmith for tracing and monitoring

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/CRAB.git
    cd CRAB
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Set up environment variables: Create a `.env` file in the project root and add your API keys:

    OPENAI_API_KEY=your_openai_api_key_here

Usage

To start CRAB, run:

python main.py

Once CRAB is running, you can:

  • Ask questions and receive RAG-enhanced responses
  • Use file system commands like "list files", "change directory", "read file"
  • Switch modes between standard and web search using "set mode standard" or "set mode web_search"
  • Type "exit" to end the chat session

Project Structure

  • main.py: Main script containing the CRAB implementation
  • requirements.txt: List of Python dependencies
  • .env: Environment variables (create this file and add your API keys)

Customization

  • Modify the RAG class to adjust retrieval and generation strategies
  • Extend the GeneralInterpreter class to add new tools or conversation states
  • Adjust the ChromaDBRetriever class to change document indexing and retrieval methods

Contributing

Contributions to CRAB