{"id":21457792,"url":"https://github.com/krik8235/rag-agents-for-chrome-extention","last_synced_at":"2026-04-13T21:02:57.950Z","repository":{"id":264028211,"uuid":"892117303","full_name":"krik8235/rag-agents-for-chrome-extention","owner":"krik8235","description":"A Chrome extension that uses AI agents to help users negotiate the best deal","archived":false,"fork":false,"pushed_at":"2024-11-21T23:17:27.000Z","size":394,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T13:33:12.148Z","etag":null,"topics":["fastapi","koyab","llama3","project","pydantic","pydantic-models","python","replit","together-ai"],"latest_commit_sha":null,"homepage":"https://rag-agent-system-chrome-extention.vercel.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krik8235.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-21T14:39:34.000Z","updated_at":"2024-11-26T15:18:35.000Z","dependencies_parsed_at":"2024-11-22T00:30:39.333Z","dependency_job_id":null,"html_url":"https://github.com/krik8235/rag-agents-for-chrome-extention","commit_stats":null,"previous_names":["krik8235/ai-agent-chrome-extention","krik8235/rag-agent-system-chrome-extention","krik8235/rag-agents-for-chrome-extention"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krik8235%2Frag-agents-for-chrome-extention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krik8235%2Frag-agents-for-chrome-extention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krik8235%2Frag-agents-for-chrome-extention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krik8235%2Frag-agents-for-chrome-extention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krik8235","download_url":"https://codeload.github.com/krik8235/rag-agents-for-chrome-extention/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971193,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","koyab","llama3","project","pydantic","pydantic-models","python","replit","together-ai"],"created_at":"2024-11-23T06:07:06.360Z","updated_at":"2026-04-13T21:02:52.928Z","avatar_url":"https://github.com/krik8235.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nA Chrome extension that uses AI agents to help users negotiate the best deals.\n\n\n[Connection test site](https://rag-agent-system-chrome-extention.vercel.app/)\n\n\u003c!-- ![UI](https://res.cloudinary.com/dfeirxlea/image/upload/v1731425753/portfolio/fsqjubnndrawnp9ezimq.png)\n\n![Terminal](https://res.cloudinary.com/dfeirxlea/image/upload/v1731425419/portfolio/mytqa9jtu8yexf6oc0k8.png) --\u003e\n\n\n## Table of Contents\n*generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Table of Contents](#table-of-contents)\n- [Overview](#overview-1)\n- [Key Features](#key-features)\n- [Technologies Used](#technologies-used)\n- [Project Structure](#project-structure)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Development](#development)\n- [Package Management](#package-management)\n- [Customizing AI Agents](#customizing-ai-agents)\n- [Modifying Prompts](#modifying-prompts)\n- [Contributing](#contributing)\n- [Troubleshooting](#troubleshooting)\n\n\n## Overview\n\nA Chrome extension that uses AI agents to help the user negotiate the best deals:\n\n1. **Context \u0026 Goal Setting**:\n   - From the chrome extention, ask users about their goals of the deal.\n   - Use Pydantic to define the schema via models\n\n2. **Negotiation Starts**:\n   - Employ Llama 3.1 (running on Together AI) and call `/browse` API endpoint via FastAPI\n   - Record the log on the negotiation.log to track the conversation\n\n3. **User Interaction**:\n   - Presents the seller's response and ask for a counter response.\n   - Allows the buyer to choose whether to accept or renegotiate.\n\n4. **Response Generation**:\n   - Collect user input.\n   - Passes the information back to Llama 3.1 on Together AI.\n   - Generates response to the end user.\n\n## Key Features\n\n- Collect user inputs via Chrome extention\n- Use Pydantic to build a schema and validate the inputs\n- AI-driven context analysis \u0026 negotiation converation using Llama 3.1 on Together AI\n- Call API via FastAPI and render response on the user-friendly interface\n- Automated generation of response drafts using Llama 3.1\n\n\n## Technologies Used\n[data-doc-management]\n\n   - Upstage: Converts natural language queries into SQL [Doc](https://console.upstage.ai/docs/getting-started/overview)\n   - Chroma DB: Vector database for storing and querying standard contract clauses\n   - SQLite: Database for storing application data\n\n[ai-model-curation]\n\n   - Together AI: Hosting Llama 3.1 for text processing, clause segmentation, and response generation\n\n[deployment-framework]\n\n   - Python: Primary programming language\n   - Poetry: Backend build system and package installer/resolver [doc](https://python-poetry.org/docs/)\n   - Pydantic: Data validation library for Python\n   - Fast API: Web framework for building APIs based on standard Python type hints\n   - Replit: Deploy Fast API on Replit server (See the `.replit` and `replit.nix` for its configuration.)\n   - Koyeb: Deploy the backend repo and access in the production env\n\n\n## Project Structure\n\n```\n.\n└── frontend - react app\n|\n└── src\n   └── __init__.py\n   └── api.py = connect with database\n   └── main.py = build fastAPI connection\n└── Prompts\n   └── Browse.py\n   └── Negotiate.py\n   └── Validate.py\n└── tests\n   └── __init__.py\n   └── test_endpoint.py: test connection to the browser endpoint\n   └── test_negotiation.py: test and log the negotiation process and outcome\n├── pyproject.toml\n└── poetry.lock\n\n\u003c Koyeb deployment\u003e\n└── requirements.txt\n└── Procfile\n└── runtime.txt\n```\n\n## Setup\n\n1. Install the `poetry` package manager:\n   ```\n   curl -sSL https://install.python-poetry.org | python -\n   poetry --version\n   ```\n\n2. Install dependencies on pyproject.toml:\n   ```\n   poetry install\n   ```\n\n3. Set up environment variables:\n   Create a `.env` file in the project root and add the following:\n   ```\n   TOGETHER_API_KEY=your_together_api_key\n   DATABASE_URL=your_database_url\n   API_ROUTE=your_public_api_route\n   ```\n\n## Usage\n\n1. Test the negotiation process and outcome on terminal:\n   ```\n   poetry run neg\n   ```\n   The outcome will be recorded in the negotiation.log file.\n\n\n2. In a separate terminal, test the connection to the client interface:\n   ```\n   poetry run client\n   ```\n   The results will be printed on your terminal.\n   When you update the `main.py`, run this command to see if the update is working properly.\n\n   The backend will be available at `http://localhost:8000`.\n\n3. Deploy the API via Koyab\n   ```\n   koyeb deploy . \u003camazing_app_name_of_your_choice\u003e/src --instance-type=free\n   ```\n   *See the [doc](https://www.koyeb.com/docs/build-and-deploy/deploy-project-directory) for the Koyeb CLI installation and more.\n\n   Now you can access the API endpoint from the public URL `...koyab.app`.\n\n\n4. Run the frontend.  (Open another terminal and set the root to `frontend`. For now, frontend contains test connection to the public API)\n   ```\n   npm i\n   npm start \n   ```\n   The frontend will be available at `http://localhost:3000`.\n\n\n## Development\n\n### Package Management with poetry\n\n- Add a package: `poetry add \u003cpackage\u003e`\n- Remove a package: `poetry remove \u003cpackage\u003e`\n- Run a command in the virtual environment: add a script to pyproject.toml, then `poetry run \u003ccommand\u003e`\n- To reinstall all the package: after deleting poetry.lock file, run `poetry install`\n\n[poetry cli](https://python-poetry.org/docs/cli/#add)\n\n\n\n### Customizing AI Agents\n\nTo modify or add new AI agents, edit the `test_negotiation.py` file to test on the terminal, and/or edit the `main.py` file to apply the modification to the API.\n\n### Modifying Prompts\n\nNecessary prompts are stored in the `Prompts` folder. Add or modify the prompt accordingly.\n\n(To avoid errors, we recommend adding a new prompt file to the Prompt folder.)\n\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/your-amazing-feature`)\n3. Commit your changes (`git commit -m 'Add your-amazing-feature'`)\n4. Push to the branch (`git push origin feature/your-amazing-feature`)\n5. Open a pull request\n\n\n\n## Troubleshooting\n\nCommon issues and solutions:\n- API key errors: Ensure all API keys in the `.env` file are correct and up to date.\n- Database connection issues: Check if the Chroma DB is properly initialized and accessible.\n- Memory errors: If processing large contracts, you may need to increase the available memory for the Python process.\n- Issues related to the AI agents: Check the `negotiation.log` file for detailed error messages and stack traces.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrik8235%2Frag-agents-for-chrome-extention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrik8235%2Frag-agents-for-chrome-extention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrik8235%2Frag-agents-for-chrome-extention/lists"}