pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/bleu/cow-ai-tools

GitHub - bleu/cow-ai-tools · GitHub
Skip to content

bleu/cow-ai-tools

 
 

Repository files navigation

cow-ai-tools

This repository provides CoW Protocol Integration Documentation chat: a RAG-based Q&A for Order Book API, order creation, approvals, and errors (aligned with the CoW Grants RFP).

Planning: docs/COW_POC_PLAN.md, docs/COW_PROPOSAL_NEXT_PHASE.md.


Overview

CoW AI is a RAG chatbot that answers integration-focused questions about CoW Protocol using CoW docs and the Order Book OpenAPI spec. Stack: file-based docs + FAISS index, Gemini for embeddings and chat, no database.

Key directories

  • data/ – Raw and processed datasets (e.g. data/cow-docs/).
  • pkg/ – Backend and RAG: cow-app (API), cow-brains (CoW RAG), rag-brains (shared RAG pipeline), cow-core (logging).
  • scripts/ – Dataset and OpenAPI scripts, tests.
  • www/ – Next.js frontend.

Prerequisites

  • Python 3.12+
  • Poetry
  • Node.js 20+
  • Yarn

Installation

  1. Clone and enter the repo:

    git clone https://github.com/bleu/cow-ai-tools.git
    cd cow-ai-tools
  2. Install backend (from repo root, with Poetry in each package or use a venv and install from pkg/cow-app):

    cd pkg/cow-app && poetry install
    cd ../cow-brains && poetry install
    cd ../rag-brains && poetry install
    cd ../cow-core && poetry install
  3. Install frontend:

    cd www && yarn install

Usage

Quick test (no API key)

From repo root:

bash scripts/test_cow_poc.sh

Full flow (FAISS + API)

  1. Create CoW docs artifact

    python scripts/cow-1-create-docs-dataset/main.py --output data/cow-docs/cow_docs.txt
  2. (Optional) Fetch Order Book OpenAPI

    python scripts/cow-2-fetch-openapi/main.py --output data/cow-docs/openapi.yml
  3. Build FAISS index (set GOOGLE_API_KEY)

    cd pkg/cow-app && OP_CHAT_BASE_PATH=../../data GOOGLE_API_KEY=... poetry run python -m cow_brains.build_faiss
  4. Run the API

    cd pkg/cow-app && cp .envrc.example .envrc   # edit GOOGLE_API_KEY
    direnv allow   # or source .envrc
    poetry run uvicorn cow_app.api:app --host 0.0.0.0 --port 8000

    Or use the helper script from repo root: bash scripts/run-backend.sh (ensure PYTHONPATH includes pkg/cow-app:pkg/rag-brains:pkg/cow-brains:pkg/cow-core).

  5. Run the frontend

    cd www && cp .envrc.example .envrc
    # Set NEXT_PUBLIC_CHAT_API_URL=http://localhost:8000/predict
    yarn dev

Golden questions: docs/cow_golden_questions.md. Evaluation: docs/cow_poc_evaluation.md. Quickstart: docs/cow_quickstart_first_order.md.

Deploy

Contact

Open an issue on GitHub or contact the maintainers.

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 98.2%
  • Python 1.2%
  • TypeScript 0.6%
  • JavaScript 0.0%
  • Shell 0.0%
  • CSS 0.0%
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy