|
1 |
| -# agent-catalog-quickstart |
| 1 | +# Agent Catalog Quickstart |
| 2 | + |
| 3 | +This repository provides a quickstart guide for using the Agent Catalog with Capella Model Services and Couchbase. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Python 3.8+ |
| 8 | +- Poetry ([Installation Guide](https://python-poetry.org/docs/#installation)) |
| 9 | +- pip (Python package installer) |
| 10 | +- Git (for repository management) |
| 11 | +- An OpenAI API Key (or other LLM provider) |
| 12 | +- Couchbase Capella account (or local Couchbase installation) |
| 13 | + |
| 14 | +## Quick Setup (Automated) |
| 15 | + |
| 16 | +The fastest way to get started is using our automated setup script: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Clone the repository |
| 20 | +git clone https://github.com/couchbaselabs/agent-catalog-quickstart.git |
| 21 | +cd agent-catalog-quickstart |
| 22 | + |
| 23 | +# Make the setup script executable |
| 24 | +chmod +x scripts/setup.sh |
| 25 | + |
| 26 | +# Run the automated setup script |
| 27 | +bash scripts/setup.sh |
| 28 | +``` |
| 29 | + |
| 30 | +This script will: |
| 31 | +- Install all Agent Catalog libraries and dependencies |
| 32 | +- Run `poetry install` at the root and in all example directories |
| 33 | +- Install required LlamaIndex packages |
| 34 | +- Create template environment files for all examples |
| 35 | +- Set up git for clean repository state |
| 36 | +- Verify the installation |
| 37 | +- Provide next steps |
| 38 | + |
| 39 | +## Manual Setup (Step-by-Step) |
| 40 | + |
| 41 | +If you prefer to install manually or need to troubleshoot: |
| 42 | + |
| 43 | +### 1. Install Agent Catalog Libraries |
| 44 | + |
| 45 | +Install all libraries in the correct dependency order: |
| 46 | + |
| 47 | +```bash |
| 48 | +# Install core library first |
| 49 | +pip install -e agent-catalog/libs/agentc_core |
| 50 | + |
| 51 | +# Install integrations |
| 52 | +pip install -e agent-catalog/libs/agentc_integrations/langchain \ |
| 53 | + -e agent-catalog/libs/agentc_integrations/langgraph \ |
| 54 | + -e agent-catalog/libs/agentc_integrations/llamaindex |
| 55 | + |
| 56 | +# Install CLI and testing |
| 57 | +pip install -e agent-catalog/libs/agentc_cli \ |
| 58 | + -e agent-catalog/libs/agentc_testing |
| 59 | + |
| 60 | +# Install main package |
| 61 | +pip install -e agent-catalog/libs/agentc |
| 62 | + |
| 63 | +# Install LlamaIndex dependencies |
| 64 | +pip install llama-index llama-index-vector-stores-couchbase |
| 65 | +``` |
| 66 | + |
| 67 | +### 2. Install Poetry Dependencies |
| 68 | + |
| 69 | +**Important:** You must run `poetry install` in multiple locations: |
| 70 | + |
| 71 | +```bash |
| 72 | +# Install root dependencies |
| 73 | +poetry install |
| 74 | + |
| 75 | +# Install dependencies for each example agent |
| 76 | +cd notebooks/route_planner_agent && poetry install && cd ../.. |
| 77 | +cd notebooks/flight_search_agent && poetry install && cd ../.. |
| 78 | +cd notebooks/hotel_support_agent && poetry install && cd ../.. |
| 79 | +``` |
| 80 | + |
| 81 | +### 3. Verify Installation |
| 82 | + |
| 83 | +```bash |
| 84 | +agentc --help |
| 85 | +``` |
| 86 | + |
| 87 | +### 4. Environment Configuration |
| 88 | + |
| 89 | +Create a `.env` file in each example directory with the following configuration: |
| 90 | + |
| 91 | +#### For Couchbase Capella (Cloud): |
| 92 | +```bash |
| 93 | +# OpenAI API Configuration |
| 94 | +OPENAI_API_KEY="your-openai-api-key" |
| 95 | + |
| 96 | +# Couchbase Configuration |
| 97 | +CB_CONN_STRING="couchbases://your-cluster.cloud.couchbase.com" |
| 98 | +CB_USERNAME="your-username" |
| 99 | +CB_PASSWORD="your-password" |
| 100 | +CB_BUCKET="vector-search-testing" |
| 101 | +CB_SCOPE="agentc_data" |
| 102 | +CB_COLLECTION="route_data" |
| 103 | +CB_INDEX="route_data_index" |
| 104 | + |
| 105 | +# Capella API Configuration |
| 106 | +CAPELLA_API_ENDPOINT="https://your-endpoint.ai.cloud.couchbase.com" |
| 107 | +CAPELLA_API_EMBEDDING_MODEL="intfloat/e5-mistral-7b-instruct" |
| 108 | +CAPELLA_API_LLM_MODEL="meta-llama/Llama-3.1-8B-Instruct" |
| 109 | + |
| 110 | +# Agent Catalog Configuration |
| 111 | +AGENT_CATALOG_CONN_STRING="couchbase://127.0.0.1" |
| 112 | +AGENT_CATALOG_BUCKET="vector-search-testing" |
| 113 | +AGENT_CATALOG_USERNAME="your-username" |
| 114 | +AGENT_CATALOG_PASSWORD="your-password" |
| 115 | +AGENT_CATALOG_CONN_ROOT_CERTIFICATE="" |
| 116 | + |
| 117 | +# Environment variable to prevent tokenizer warnings |
| 118 | +TOKENIZERS_PARALLELISM=false |
| 119 | +``` |
| 120 | + |
| 121 | +#### For Local Couchbase: |
| 122 | +```bash |
| 123 | +# OpenAI API Configuration |
| 124 | +OPENAI_API_KEY="your-openai-api-key" |
| 125 | + |
| 126 | +# Couchbase Configuration |
| 127 | +CB_CONN_STRING="couchbase://127.0.0.1" |
| 128 | +CB_USERNAME="Administrator" |
| 129 | +CB_PASSWORD="password" |
| 130 | +CB_BUCKET="default" |
| 131 | +CB_SCOPE="_default" |
| 132 | +CB_COLLECTION="_default" |
| 133 | +CB_INDEX="vector_index" |
| 134 | + |
| 135 | +# Agent Catalog Configuration |
| 136 | +AGENT_CATALOG_CONN_STRING="couchbase://127.0.0.1" |
| 137 | +AGENT_CATALOG_BUCKET="default" |
| 138 | +AGENT_CATALOG_USERNAME="Administrator" |
| 139 | +AGENT_CATALOG_PASSWORD="password" |
| 140 | +AGENT_CATALOG_CONN_ROOT_CERTIFICATE="" |
| 141 | + |
| 142 | +# Environment variable to prevent tokenizer warnings |
| 143 | +TOKENIZERS_PARALLELISM=false |
| 144 | +``` |
| 145 | + |
| 146 | +**Important:** Each example directory needs its own `.env` file: |
| 147 | +- `notebooks/route_planner_agent/.env` |
| 148 | +- `notebooks/flight_search_agent/.env` |
| 149 | +- `notebooks/hotel_support_agent/.env` |
| 150 | + |
| 151 | +## Usage |
| 152 | + |
| 153 | +### Initialize Agent Catalog |
| 154 | + |
| 155 | +Navigate to any example directory and initialize: |
| 156 | + |
| 157 | +```bash |
| 158 | +cd notebooks/route_planner_agent |
| 159 | +agentc init |
| 160 | +``` |
| 161 | + |
| 162 | +### Index Your Agent |
| 163 | + |
| 164 | +```bash |
| 165 | +agentc index . |
| 166 | +``` |
| 167 | + |
| 168 | +### Publish Your Agent |
| 169 | + |
| 170 | +**Important:** The git repository must be clean before publishing: |
| 171 | + |
| 172 | +```bash |
| 173 | +# Commit any changes first |
| 174 | +git add . |
| 175 | +git commit -m "Your commit message" |
| 176 | + |
| 177 | +# Then publish |
| 178 | +agentc publish |
| 179 | +``` |
| 180 | + |
| 181 | +### Run Example Agents |
| 182 | + |
| 183 | +```bash |
| 184 | +# Run the route planner agent |
| 185 | +python main.py |
| 186 | + |
| 187 | +# Run with specific queries |
| 188 | +python main.py "Find a route from San Francisco to Los Angeles" |
| 189 | +``` |
| 190 | + |
| 191 | +## Available Examples |
| 192 | + |
| 193 | +This quickstart includes several example agents: |
| 194 | + |
| 195 | +- **Route Planner Agent** (`notebooks/route_planner_agent/`) - Plans routes between locations |
| 196 | +- **Flight Search Agent** (`notebooks/flight_search_agent/`) - Searches and books flights |
| 197 | +- **Hotel Support Agent** (`notebooks/hotel_support_agent/`) - Hotel search and support |
| 198 | +- **Customer Support Agent** (`notebooks/customer_support_agent/`) - General customer support |
| 199 | + |
| 200 | +Each example includes: |
| 201 | +- Complete source code |
| 202 | +- Configuration files |
| 203 | +- Test cases |
| 204 | +- Documentation |
| 205 | +- **Own poetry dependencies** (requires `poetry install` in each directory) |
| 206 | + |
| 207 | +## Agent Catalog CLI Commands |
| 208 | + |
| 209 | +| Command | Description | |
| 210 | +|---------|-------------| |
| 211 | +| `agentc init` | Initialize agent catalog in current directory | |
| 212 | +| `agentc index .` | Index the current agent directory | |
| 213 | +| `agentc publish` | Publish agent to catalog (requires clean git status) | |
| 214 | +| `agentc --help` | Show all available commands | |
| 215 | +| `agentc env` | Show environment configuration | |
| 216 | + |
| 217 | +## Troubleshooting |
| 218 | + |
| 219 | +### Common Issues |
| 220 | + |
| 221 | +1. **"command not found: agentc"** |
| 222 | + - Run the setup script: `bash scripts/setup.sh` |
| 223 | + - Or install manually following the manual setup steps |
| 224 | + |
| 225 | +2. **"No module named 'llama_index.vector_stores'"** |
| 226 | + - Install LlamaIndex: `pip install llama-index llama-index-vector-stores-couchbase` |
| 227 | + - Run `poetry install` in the example directory |
| 228 | + |
| 229 | +3. **"Could not find the environment variable $AGENT_CATALOG_CONN_STRING"** |
| 230 | + - Ensure each example directory has its own `.env` file |
| 231 | + - Include `AGENT_CATALOG_CONN_ROOT_CERTIFICATE=""` in the `.env` file |
| 232 | + |
| 233 | +4. **"Cannot publish a dirty catalog to the DB"** |
| 234 | + - Commit all changes: `git add . && git commit -m "Your message"` |
| 235 | + - Ensure `git status` shows a clean repository before `agentc publish` |
| 236 | + |
| 237 | +5. **Connection errors to Couchbase** |
| 238 | + - Verify your `.env` configuration in each example directory |
| 239 | + - Check that your Couchbase cluster is accessible |
| 240 | + - Ensure proper credentials and connection strings |
| 241 | + |
| 242 | +6. **"Certificate error" when connecting** |
| 243 | + - For local installations, use `couchbase://127.0.0.1` |
| 244 | + - For Capella, ensure you're using the correct `couchbases://` connection string |
| 245 | + - Include `AGENT_CATALOG_CONN_ROOT_CERTIFICATE=""` in your `.env` |
| 246 | + |
| 247 | +7. **Poetry dependency issues** |
| 248 | + - Run `poetry install` in the root directory |
| 249 | + - Run `poetry install` in each example directory separately |
| 250 | + - Each example has its own `pyproject.toml` and requires separate installation |
| 251 | + |
| 252 | +8. **Tokenizer parallelism warnings** |
| 253 | + - Add `TOKENIZERS_PARALLELISM=false` to your `.env` files |
| 254 | + |
| 255 | +### Setup Requirements Checklist |
| 256 | + |
| 257 | +- [ ] Poetry installed |
| 258 | +- [ ] Agent Catalog libraries installed (`pip install -e ...`) |
| 259 | +- [ ] LlamaIndex installed (`pip install llama-index llama-index-vector-stores-couchbase`) |
| 260 | +- [ ] Root poetry dependencies installed (`poetry install` in root) |
| 261 | +- [ ] Example poetry dependencies installed (`poetry install` in each example directory) |
| 262 | +- [ ] `.env` files created in each example directory |
| 263 | +- [ ] Environment variables configured with actual credentials |
| 264 | +- [ ] Git repository in clean state (for publishing) |
| 265 | + |
| 266 | +### Getting Help |
| 267 | + |
| 268 | +- Check the `docs/` directory for detailed guides |
| 269 | +- Look at example implementations in `notebooks/` |
| 270 | +- Review error messages for specific configuration issues |
| 271 | +- Ensure you've run `poetry install` in all required directories |
| 272 | + |
| 273 | +## Development |
| 274 | + |
| 275 | +### Adding New Agents |
| 276 | + |
| 277 | +1. Create a new directory under `notebooks/` |
| 278 | +2. Add your agent code, prompts, and tools |
| 279 | +3. Create appropriate configuration files (`pyproject.toml`, `.env`) |
| 280 | +4. Run `poetry install` in the new directory |
| 281 | +5. Run `agentc init` and `agentc index .` |
| 282 | + |
| 283 | +### Running Tests |
| 284 | + |
| 285 | +```bash |
| 286 | +cd notebooks/route_planner_agent |
| 287 | +python -m pytest tests/ |
| 288 | +``` |
| 289 | + |
| 290 | +### Evaluation |
| 291 | + |
| 292 | +Run evaluations with Arize: |
| 293 | + |
| 294 | +```bash |
| 295 | +python run_evaluations.py |
| 296 | +``` |
| 297 | + |
| 298 | +## Architecture |
| 299 | + |
| 300 | +Each example agent follows this structure: |
| 301 | +``` |
| 302 | +notebooks/agent_name/ |
| 303 | +├── main.py # Main agent implementation |
| 304 | +├── pyproject.toml # Poetry dependencies (requires poetry install) |
| 305 | +├── .env # Environment configuration |
| 306 | +├── prompts/ # Agent prompts and templates |
| 307 | +├── tools/ # Agent tools and functions |
| 308 | +├── data/ # Data loading and processing |
| 309 | +├── tests/ # Test cases |
| 310 | +└── evals/ # Evaluation scripts |
| 311 | +``` |
| 312 | + |
| 313 | +## Contributing |
| 314 | + |
| 315 | +This is a quickstart repository. For contributing to the main Agent Catalog: |
| 316 | + |
| 317 | +1. Fork the repository |
| 318 | +2. Create a feature branch |
| 319 | +3. Make your changes |
| 320 | +4. Ensure all poetry dependencies are installed |
| 321 | +5. Commit changes (required for publishing) |
| 322 | +6. Submit a pull request |
| 323 | + |
| 324 | +## License |
| 325 | + |
| 326 | +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. |
| 327 | + |
0 commit comments