Skip to content

Commit 2315cdb

Browse files
authored
Merge pull request #1 from couchbase-examples/DA-904-develop-a-quickstart-tutorial-using-agent-catalog-capella-model-services
(feat) Agent Catalog Quickstart
2 parents 36e0bef + b3854bd commit 2315cdb

File tree

82 files changed

+34410
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+34410
-2
lines changed

.cursorrules

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
this is the repo for agent catalog and for the quickstart just create a new folder called quickstart. Start by doing ls -R to know the heirarchy of the app
2+
3+
the root directory is the quickstart itself. while agent-catalog is downloaded at the root directory as well
4+
5+
lets not start with notebook creation. lets create, run and finetune regular scripts and then i'll create the notebook manually later. some basic files are already created. although i am not sure if they will be
6+
7+
There are 3 apps in the notebooks folder
8+
9+
The Flight search agent is built with Langraph
10+
The Hotel support agent is built with langchain
11+
The Landmark search agent is built with llamaindex
12+
13+
All the tutorials use agentc for finding tools and prompts in their respective folders
14+
15+
We use Couchbase Vector store for storing the embeddings and the data.
16+
We use Arize for the evaluation of the agents.

.gitignore

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# The repo itself
2+
agent-catalog/
3+
couchbase/
4+
5+
# The quickstart folder
6+
.agent-catalog/
7+
.agent-activity/
8+
.model-cache/
9+
10+
# Arize
11+
*.csv
12+
13+
# VS Code and Cursor stuff
14+
.vscode/
15+
.cursorignore
16+
.cursorindexingignore
17+
.qodo/
18+
119
# Byte-compiled / optimized / DLL files
220
__pycache__/
321
*.py[cod]
@@ -33,6 +51,7 @@ MANIFEST
3351
*.spec
3452

3553
# Installer logs
54+
poetry.lock
3655
pip-log.txt
3756
pip-delete-this-directory.txt
3857

@@ -191,4 +210,5 @@ cython_debug/
191210
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192211
# refer to https://docs.cursor.com/context/ignore-files
193212
.cursorignore
194-
.cursorindexingignore
213+
.cursorindexingignore
214+
.cursor/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.8

README.md

Lines changed: 327 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,327 @@
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

Comments
 (0)