Skip to content

pa-vector-search

by rob

Data

Performs semantic search against a ChromaDB vector collection. Parses query from JSON input, queries the collection using embeddings, and returns matching results with similarity distances.

# pa-vector-search

Performs semantic search against a ChromaDB vector collection. Parses query from JSON input, generates embedding using pa-embed, queries the collection, and returns matching results with similarity distances.

## Installation

This is a CmdForge tool. It's installed via the CmdForge registry and invoked via command line or pipe.

```bash
cmdforge install pa-vector-search
```

## Usage

The tool accepts JSON input via pipe containing a `query` field:

```bash
echo '{"query": "conversation about tasks"}' | pa-vector-search --path ~/.pa2/data/chroma

echo '{"query": "recent meetings", "n_results": 5}' | pa-vector-search \
  --path /path/to/chroma \
  --collection my_memories \
  --embed-model nomic-embed-text
```

**Input format:**
```json
{
  "query": "search text",
  "n_results": 10
}
```

**Output format:**
```json
{
  "ids": [["id1", "id2"]],
  "documents": [["text1", "text2"]],
  "distances": [[0.12, 0.34]],
  "metadatas": [[{"key": "value"}, {...}]]
}
```

## Arguments

| Flag | Default | Description |
|------|---------|-------------|
| `--path` | *(required)* | ChromaDB persist directory |
| `--collection` | `memories` | Collection name |
| `--embed-model` | `nomic-embed-text` | Ollama model for embeddings |

## How It Works

1. **parse_and_search**: Parses JSON input to extract query text, generates embedding via `pa-embed`, queries the specified ChromaDB collection, and returns results with similarity distances

## Dependencies

- **pa-embed**: Used to generate embeddings for the search query

No reviews yet.

Issues

No issues reported for this tool.