llama-stack/llama_stack/distribution
Daniele Martinoli fb998683e0
fix: Agent uses the first configured vector_db_id when documents are provided (#1276)
# What does this PR do?
The agent API allows to query multiple DBs using the `vector_db_ids`
argument of the `rag` tool:
```py
        toolgroups=[
            {
                "name": "builtin::rag",
                "args": {"vector_db_ids": [vector_db_id]},
            }
        ],
```
This means that multiple DBs can be used to compose an aggregated
context by executing the query on each of them.

When documents are passed to the next agent turn, there is no explicit
way to configure the vector DB where the embeddings will be ingested. In
such cases, we can assume that:
- if any `vector_db_ids` is given, we use the first one (it probably
makes sense to assume that it's the only one in the list, otherwise we
should loop on all the given DBs to have a consistent ingestion)
- if no `vector_db_ids` is given, we can use the current logic to
generate a default DB using the default provider. If multiple providers
are defined, the API will fail as expected: the user has to provide
details on where to ingest the documents.

(Closes #1270)

## Test Plan
The issue description details how to replicate the problem.

[//]: # (## Documentation)

---------

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
2025-03-04 21:44:13 -08:00
..
routers fix: Agent uses the first configured vector_db_id when documents are provided (#1276) 2025-03-04 21:44:13 -08:00
server feat: add more logs to agent_instance.py 2025-03-03 16:15:47 -08:00
store refactor: move a few tests to top-level tests/ directory 2025-03-03 17:33:39 -08:00
ui chore: rename task_config to benchmark_config (#1397) 2025-03-04 12:44:04 -08:00
utils fix: check conda env name using basepath in exec.py (#1301) 2025-02-27 23:07:23 -08:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
build.py build(container): misc improvements (#1291) 2025-02-28 10:01:52 -08:00
build_conda_env.sh chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
build_container.sh chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
build_venv.sh chore: remove straggler references to llama-models (#1345) 2025-03-01 14:26:03 -08:00
client.py chore: move all Llama Stack types from llama-models to llama-stack (#1098) 2025-02-14 09:10:59 -08:00
common.sh fix: Fixing some small issues with the build scripts (#1132) 2025-02-19 22:20:49 -08:00
configure.py build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00
datatypes.py fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
distribution.py chore(lint): update Ruff ignores for project conventions and maintainability (#1184) 2025-02-28 09:36:49 -08:00
inspect.py fix: improve signal handling and update dependencies (#1044) 2025-02-13 08:07:59 -08:00
library_client.py fix: raise error when request param failed to convert (#1339) 2025-03-01 10:39:05 -08:00
request_headers.py Add X-LlamaStack-Client-Version, rename ProviderData -> Provider-Data (#735) 2025-01-09 11:51:36 -08:00
resolver.py feat: add more logs to agent_instance.py 2025-03-03 16:15:47 -08:00
stack.py feat: add a configurable category-based logger (#1352) 2025-03-02 18:51:14 -08:00
start_stack.sh feat: add a configurable category-based logger (#1352) 2025-03-02 18:51:14 -08:00