Repository navigation
Conversation
Signed-off-by: MesekerWK <meseker.fisseha@gmail.com>
Signed-off-by: MesekerWK <meseker.fisseha@gmail.com>
Signed-off-by: MesekerWK <meseker.fisseha@gmail.com>
joshanderson-sas
left a comment
There was a problem hiding this comment.
This looks good. One request though. Let's remove the "Tag filtering" part and just leave it at metadata filtering.
It's a bit confusing that we are combining two different features into a single example and the tags part doesn't really make sense (there's only one file).
We should make a separate example for "tags" and in that one there could be multiple files that get separate tags. We should also add custom source example code for applying a tag (if that doesn't already exist here)
…tom source example
Signed-off-by: joshanderson-sas <josh.anderson@sas.com>
Signed-off-by: joshanderson-sas <josh.anderson@sas.com>
Signed-off-by: joshanderson-sas <josh.anderson@sas.com>
Signed-off-by: joshanderson-sas <josh.anderson@sas.com>
Signed-off-by: joshanderson-sas <josh.anderson@sas.com>
| response = ram_client.post_query( | ||
| prompt=question, | ||
| search_kwargs=search_kwargs, | ||
| persistent=False, |
There was a problem hiding this comment.
Why is persistent false here?
| The entry point in [run.py](./run.py) writes three text files under `/tmp` | ||
| and saves each with `client.save_file(filepath)`. It then applies tags with | ||
| `client.add_tags_to_file(filename, tags)`, using the matching source filename | ||
| without the `/tmp/` prefix. | ||
| Each tag is a `SourceClient.FileTag` with a name and description. | ||
|
|
||
| The password reset guide receives both its topic tag and an onboarding tag in | ||
| the same tagging call. The files are written directly under `/tmp`, not inside | ||
| a randomly named temporary directory, to keep source filenames stable. | ||
|
|
||
| This example uses separate save and tag calls because `save_file(..., tags=...)` | ||
| was observed to produce an untagged file and a second, tagged file under a random | ||
| temporary path in the reported RAM runtime. This behavior may depend on the | ||
| runtime version; verify that synchronization produces only the three filenames |
There was a problem hiding this comment.
| The entry point in [run.py](./run.py) writes three text files under `/tmp` | |
| and saves each with `client.save_file(filepath)`. It then applies tags with | |
| `client.add_tags_to_file(filename, tags)`, using the matching source filename | |
| without the `/tmp/` prefix. | |
| Each tag is a `SourceClient.FileTag` with a name and description. | |
| The password reset guide receives both its topic tag and an onboarding tag in | |
| the same tagging call. The files are written directly under `/tmp`, not inside | |
| a randomly named temporary directory, to keep source filenames stable. | |
| This example uses separate save and tag calls because `save_file(..., tags=...)` | |
| was observed to produce an untagged file and a second, tagged file under a random | |
| temporary path in the reported RAM runtime. This behavior may depend on the | |
| runtime version; verify that synchronization produces only the three filenames | |
| The entry point in [run.py](./run.py) writes three text files under `/tmp` | |
| and saves each with `client.save_file(filepath)`. It then applies tags with | |
| `client.add_tags_to_file(filename, tags)`, using the matching source filename. | |
| Each tag is a `SourceClient.FileTag` with a name and description. |
| The example does not clear the source or delete unrelated files. It uses fixed | ||
| filenames and tag names rather than generating new names for each synchronization. | ||
| If earlier versions created entries such as `tmp.../password_reset.txt`, remove | ||
| those obsolete entries manually; this example does not clean them up. |
There was a problem hiding this comment.
| The example does not clear the source or delete unrelated files. It uses fixed | |
| filenames and tag names rather than generating new names for each synchronization. | |
| If earlier versions created entries such as `tmp.../password_reset.txt`, remove | |
| those obsolete entries manually; this example does not clean them up. |
| File tags label whole documents. They are separate from the record-level | ||
| metadata filters demonstrated by the | ||
| [metadata filtering agent](../../agents/metadata_filtering_agent/). | ||
| This source demonstrates applying tags, not configuring agent retrieval filters. |
There was a problem hiding this comment.
| This source demonstrates applying tags, not configuring agent retrieval filters. |
| ## Agentic Retrieval vs Template-Based Filtering | ||
|
|
||
| Agentic Retrieval is often the easiest option when users interact directly with an agent and are unlikely to know the underlying metadata schema. | ||
|
|
||
| A template-based approach may be a better fit when retrieval filters must be explicitly controlled, generated by another application, or applied consistently across repeated queries. |
There was a problem hiding this comment.
| ## Agentic Retrieval vs Template-Based Filtering | |
| Agentic Retrieval is often the easiest option when users interact directly with an agent and are unlikely to know the underlying metadata schema. | |
| A template-based approach may be a better fit when retrieval filters must be explicitly controlled, generated by another application, or applied consistently across repeated queries. |
Added a reusable RAM agent template that accepts JSON filters for source tags and custom metadata, including combined filters.