Metadata-Version: 2.4
Name: vorp
Version: 0.1.4
Summary: A terminal-based AI companion.
Author-email: Siddharth Bayapureddy <siddharthbayapureddy@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/SiddharthBayapureddy/vorp
Project-URL: Repository, https://github.com/SiddharthBayapureddy/vorp.git
Project-URL: Issues, https://github.com/SiddharthBayapureddy/vorp/issues
Project-URL: Source Code, https://github.com/SiddharthBayapureddy/vorp
Keywords: ai,llm,cli,terminal,assistant,rag,chatbot,developer-tools
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Terminals
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: aiohappyeyeballs==2.6.1
Requires-Dist: aiohttp==3.13.2
Requires-Dist: aiosignal==1.4.0
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.12.0
Requires-Dist: attrs==25.4.0
Requires-Dist: certifi==2025.11.12
Requires-Dist: charset-normalizer==3.4.4
Requires-Dist: click==8.3.1
Requires-Dist: colorama==0.4.6
Requires-Dist: distro==1.9.0
Requires-Dist: dotenv==0.9.9
Requires-Dist: fastuuid==0.14.0
Requires-Dist: filelock==3.20.0
Requires-Dist: frozenlist==1.8.0
Requires-Dist: fsspec==2025.12.0
Requires-Dist: grpcio==1.67.1
Requires-Dist: h11==0.16.0
Requires-Dist: hf-xet==1.2.0
Requires-Dist: httpcore==1.0.9
Requires-Dist: httpx==0.28.1
Requires-Dist: huggingface_hub==1.2.2
Requires-Dist: idna==3.11
Requires-Dist: importlib_metadata==8.7.0
Requires-Dist: Jinja2==3.1.6
Requires-Dist: jiter==0.12.0
Requires-Dist: jsonschema==4.25.1
Requires-Dist: jsonschema-specifications==2025.9.1
Requires-Dist: litellm==1.80.9
Requires-Dist: markdown-it-py==4.0.0
Requires-Dist: MarkupSafe==3.0.3
Requires-Dist: mdurl==0.1.2
Requires-Dist: multidict==6.7.0
Requires-Dist: openai==2.9.0
Requires-Dist: packaging==25.0
Requires-Dist: propcache==0.4.1
Requires-Dist: pydantic==2.12.5
Requires-Dist: pydantic_core==2.41.5
Requires-Dist: Pygments==2.19.2
Requires-Dist: python-dotenv==1.2.1
Requires-Dist: PyYAML==6.0.3
Requires-Dist: referencing==0.37.0
Requires-Dist: regex==2025.11.3
Requires-Dist: requests==2.32.5
Requires-Dist: rich==14.2.0
Requires-Dist: rpds-py==0.30.0
Requires-Dist: shellingham==1.5.4
Requires-Dist: sniffio==1.3.1
Requires-Dist: tiktoken==0.12.0
Requires-Dist: tokenizers==0.22.1
Requires-Dist: tqdm==4.67.1
Requires-Dist: typer==0.20.0
Requires-Dist: typer-slim==0.20.0
Requires-Dist: typing-inspection==0.4.2
Requires-Dist: typing_extensions==4.15.0
Requires-Dist: urllib3==2.3.0
Requires-Dist: yarl==1.22.0
Requires-Dist: zipp==3.23.0
Requires-Dist: chromadb==1.3.7

# 🧠 vorp

<img src="https://raw.githubusercontent.com/SiddharthBayapureddy/vorp/master/logo.jpeg" alt="vorp logo" width="200">

**vorp** is a terminal-based AI pair programmer. It indexes your codebase, allowing you to ask context-aware questions and retrieve relevant code snippets without leaving your command line environment.

> **Note:** This project is under active development.

## 🚀 Key Features

*   **RAG (Chat with Codebase):** Index any project folder to enable context-aware queries.
    *   **Project Isolation:** Uses a global vector database with metadata filtering. Context from Project A will never leak into Project B.
    *   **Local Storage:** All embeddings are stored locally in `~/.vorp_rag_db`.
*   **Multi-Model Support:** Integrates with Groq and Google Gemini to provide access to models like Llama 3.3, DeepSeek R1, and Gemini 2.5 Pro.
*   **Session Persistence:** Chat history is saved locally, allowing you to resume sessions later.
*   **Context Management:** Manually inject specific files into the context window for targeted assistance.
*   **Cross-Platform:** Designed to work consistently on Windows, macOS, and Linux.

## 🛠️ Installation

### Prerequisites
*   Python 3.10+
*   Git

### Steps

1.  **Clone the repository:**
    ```bash
    git clone https://github.com/SiddharthBayapureddy/vorp.git
    cd vorp
    ```
    *(Note: If the repository is renamed to `vorp`, clone that instead.)*

2.  **Create a virtual environment:**
    *   **Windows:**
        ```bash
        python -m venv venv
        .\venv\Scripts\activate
        ```
    *   **macOS/Linux:**
        ```bash
        python3 -m venv venv
        source venv/bin/activate
        ```

3.  **Install dependencies:**
    ```bash
    pip install -e .
    ```

4.  **Configure API Keys:**
    Create a `.env` file in the root directory and add your keys:
    ```env
    GROQ_API_KEY=your_key_here
    GEMINI_API_KEY=your_key_here
    ```

## 🎮 Usage

Start the application:
```bash
vorp
```

### Interactive Commands

| Command | Description |
| :--- | :--- |
| `/index <path>` | Scans and indexes the specified directory. This creates a searchable vector index for RAG. |
| `/rag` | Toggles RAG mode on or off. When enabled, the assistant retrieves context from the indexed project. |
| `/add <file>` | Loads the content of a specific file into the active chat context. |
| `/context` | Displays a list of currently loaded files and the active RAG project path. |
| `/clear` | Clears the terminal screen. |
| `/exit-v` | Exits the application and **saves** the current chat history. |
| `/exit` | Exits the application and **deletes** the current chat history. |

### CLI Arguments

You can configure `vorp` at startup using these flags:

| Flag | Description |
| :--- | :--- |
| `--model <id>` | Starts the session with a specific model (e.g., `groq/llama-3.3-70b-versatile`). |
| `--list` | Lists all supported models and their IDs, then exits. |
| `--help` | Displays the help message. |

*Example:*
```bash
vorp --model "gemini/gemini-2.5-pro"
```

## 🏗️ Architecture

The Retrieval-Augmented Generation (RAG) system in `vorp` is built for speed and privacy. Here is how it works under the hood:

1.  **Ingestion & Chunking:**
    *   When you run `/index`, the system walks through your project directory.
    *   Files are read and split into smaller segments using a **Sliding Window** approach (1000 characters with 200 character overlap). This ensures that context at the boundaries of chunks is preserved.

2.  **Embedding Generation:**
    *   Each chunk is passed through the `all-MiniLM-L6-v2` model. This is a lightweight, high-performance model that runs locally on your CPU.
    *   The model converts the text code into a 384-dimensional vector (a list of numbers representing the semantic meaning).

3.  **Vector Storage (ChromaDB):**
    *   These vectors are stored in **ChromaDB**, a persistent local vector database located at `~/.vorp_rag_db`.
    *   **Isolation Layer:** Every vector is tagged with a `project_id` metadata field (the absolute path of the project). This acts as a strict filter, ensuring that queries only search within the active project's scope.

4.  **Retrieval (Cosine Similarity):**
    *   When you ask a question in RAG mode, your query is embedded using the same model.
    *   The database performs a similarity search (using Cosine Similarity) to find the top 5 chunks that are mathematically closest to your query.
    *   This retrieval is strictly filtered by the active `project_id`.

5.  **Context Injection:**
    *   The retrieved code snippets are formatted and injected into the LLM's system prompt.
    *   The LLM then generates an answer using this retrieved knowledge, allowing it to "see" your code.

## 🔮 Roadmap

*   **File Editing:** Capabilities for the agent to autonomously modify files.
*   **Command Execution:** Safe execution of shell commands for testing and linting.
*   **Diff View:** Enhanced visualization of code changes.

## 🤝 Contributing

Contributions are welcome. Please open an issue or submit a pull request for any improvements.
