This project provides comprehensive documentation and a web interface for the Cohere Compass SDK, making it easier to understand and work with the SDK.
The project consists of two main components:
- SDK Documentation: Comprehensive documentation for the Cohere Compass SDK, including API reference, guides, and examples.
- Web Interface: A Flask-based web application that provides an interactive interface for working with the SDK.
The documentation is built using Sphinx and includes:
- API Reference: Complete reference for all classes, methods, and properties
- Guides: Step-by-step guides for common tasks
- Examples: Practical code examples demonstrating SDK usage
To build the documentation:
-
Install the dependencies:
pip install -r requirements.txt
-
Build the HTML documentation:
cd docs make html -
Open the documentation in your browser:
open docs/build/html/index.html
The web interface provides a user-friendly way to interact with the Cohere Compass SDK, including:
- Index Management: View, create, and manage indexes
- Document Management: Upload and search documents through a user-friendly interface
- Search Interface: Search indexes with customizable parameters and view results
- API Explorer: Interactive testing of SDK methods with automatic form generation
- Chat Integration: Chat with your documents using Cohere's powerful LLMs
- Settings Management: Configure API keys and select chat models
To run the web interface:
-
Make sure you have the required environment variables set in a
.envfile in the project root:COMPASS_API_URL=your-compass-api-url COMPASS_API_BEARER_TOKEN=your-api-token COMPASS_PARSER_URL=your-compass-parser-url COMPASS_PARSER_BEARER_TOKEN=your-parser-token COHERE_API_KEY=your-cohere-api-key FLASK_SECRET_KEY=your-flask-secret-key -
Install the dependencies:
pip install -r requirements.txt
-
Start the web interface:
python -m web_interface.app
-
Open your browser and navigate to:
http://localhost:8000
compass-case/
├── cohere_compass/ # The SDK package
├── docs/ # Documentation
│ ├── build/ # Generated documentation
│ ├── source/ # Source files for documentation
│ └── Makefile # For building documentation
├── web_interface/ # Web interface application
│ ├── static/ # Static files (CSS, JS)
│ │ ├── css/ # Stylesheet files
│ │ └── js/ # JavaScript files
│ ├── templates/ # HTML templates
│ │ ├── index.html # Home page
│ │ ├── indexes.html # Indexes list
│ │ ├── chat.html # Chat interface
│ │ ├── settings.html # Settings page
│ │ └── ... # Other templates
│ ├── app.py # Flask application
│ └── settings.pkl # Stored settings
├── .env # Environment variables
└── requirements.txt # Project dependencies
The documentation is designed to work well with Cursor's "vibe coding" features:
- Well-formatted Docstrings: All classes and methods have comprehensive docstrings
- Type Annotations: Complete type hints for better autocompletion
- Module Structure: Clear organization of modules for easy navigation
The web interface includes a powerful chat capability that allows users to:
- Chat with specific indexes using Cohere's LLM models
- See search results used as context for generating responses
- Configure different chat models through the settings page
- Use both single-index and multi-index chat interfaces
When chatting with documents, the interface shows:
- Relevant document chunks used as context
- Document metadata including IDs and relevance scores
- Full text viewing in a modal dialog
The application includes a settings page that allows users to:
- Store Compass API Bearer Token
- Configure Cohere API Key
- Select from available chat models
- View model capabilities and context lengths
Contributions to improve the documentation or web interface are welcome. Please follow these steps:
- Fork the repository
- Create a branch for your changes
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.