Skip to content

Conversation

van-go
Copy link
Contributor

@van-go van-go commented Jul 17, 2025

Overview:

  • Adds view that connects to our chromadb instance, retrieves related projects, and connects to an ollama model running on Tejas to retrieve a list of suggested keywords for a given project, provided the project title and description.
  • Queries to the api are rate limited by the client to 1 per second.
  • Keyword suggestions component that is rendered in the project creation modal, project edit modal, and perhaps the project publication pipeline
  • Adds hook to retrieve suggestions from endpoint, only if project title and description both exist

PR Status:

  • Ready.

Testing Steps:

  1. Update your designsafe.env secrets locally with the latest from stache, which include secrets for chromadb and Tejas.
  2. Edit a project, and ensure it has a project type set
  3. Edit your title and description, and confirm you see relevant keywords suggested
    • This should work for EVERY project type: Other, Experimental, Field Research, Simulation, Hybrid Simulation, and Research Software
    • if either field is empty, you should be prompted to "Enter a project title and description to see keyword suggestions."
    • If both are filled, but then deleted, you should get the same prompt
    • When new title and description are entered, you should see "Finding suggestions..." until suggestions appear.
  4. The above is true at the entity level
    • Simulation --> Add Simulation
    • Experimental --> Add Experiment
    • Hybrid Sim --> Add Hybrid Sim
    • Field Research --> Add Mission
    • Field Research --> Add Document

UI Photos:

New Project pic Edit Project pic Simulation Edit Sim pic FR - Document FR - Mission Experimental Hybrid Sim

TODO:

Along with adding Natural Hazard type at the project level to the RAG, each entities has their own required fields that can be helpful, such as:
Simulation --> Simulation type, and Hyb Sim --> Hyb Sim type. None of the other ones have required fields that might be helpful.

Copy link
Contributor

@fnets fnets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great to me! Good job!

van-go added 2 commits July 23, 2025 12:08
…l and update BaseProjectForm to import via the alias instead of a relative path
@jarosenb jarosenb marked this pull request as draft August 1, 2025 18:26
rstijerina and others added 6 commits August 6, 2025 14:08
* wip rag as view

* add CHROMA_ENDPOINT setting

* fix missing packages; fix image tag

* import SN settings from designsafe.env

* working rag view

* add error handling; add debounce to rag requests

* fix linting

* add test settings

* use prev value as placeholder; memoize watched values and set debounce to 1 sec

* linting

* Task/WC-179: Software publication type (#1633)

* implement Software publication type

* fixes for testing session issues

* task/WC-307: updating search checkboxes to include software type (#1637)

* implement Software publication type

* adding new software checkbox to right search menu

* fixing spacing issue hopefully

* adding back missing tag

* another spacing fix

* yet another spacing fix

---------

Co-authored-by: Jake Rosenberg <[email protected]>

* adding extra words to publish-amend-version button (#1628)

Co-authored-by: Jake Rosenberg <[email protected]>

* adding flags for tombstones to disable file listings and entity trees (#1621)

Co-authored-by: Jake Rosenberg <[email protected]>

---------

Co-authored-by: Jake Rosenberg <[email protected]>
Co-authored-by: Sarah Gray <[email protected]>
@rstijerina rstijerina force-pushed the task/WIN-40-keyword-suggestion-client-side-component branch from 9a88c5a to d1a0361 Compare September 12, 2025 21:42
@rstijerina rstijerina marked this pull request as ready for review September 12, 2025 21:43
@rstijerina rstijerina changed the title Task/win 40 keyword suggestion client side component Feature: AI keyword suggestions Sep 12, 2025
@rstijerina rstijerina changed the title Feature: AI keyword suggestions Feature: AI project keyword suggestions Sep 12, 2025
@fnets fnets self-requested a review September 22, 2025 14:48
Copy link
Contributor

@fnets fnets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linting check is failing for designsafe/apps/api/ai_keywords/views.py

rstijerina and others added 7 commits October 6, 2025 12:39
…ion workflow (#1656)

* add publication metadata to chromadb as part of publication workflow

* linting

* linting
#1651)

* move keyword field below description. add helper text to keyword suggestions

* formatting

* formatting

---------

Co-authored-by: Sal Tijerina <[email protected]>
@van-go van-go requested review from SilversunKSauri, fnets and rstijerina and removed request for SilversunKSauri and jmartinez-tacc October 20, 2025 17:06
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea

@fnets fnets self-requested a review October 20, 2025 19:15
Copy link
Contributor

@fnets fnets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and works locally! Also super clean, thanks! I had some feedback, but feel free to disregard it if it doesn't make sense to address.

);
}

if (error) return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm opening a can of worms here, but is this how we want to handle errors? Or should we let the user know that there's an issue with the model? Or should we log the error for our own debugging?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we encounter errors for this feature, they should be hidden from the user. We log errors on the backend, so good there.

<em style={{ color: 'rgba(0,0,0,.45)' }}>Finding suggestions…</em>
</div>
) : list.length === 0 ? (
<em style={{ color: 'rgba(0,0,0,.45)' }}>No suggestions yet.</em>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another annoying can of worms that I might be opening up, but are there any CSS classes or styling we would want to use instead of setting it manually in the JSX like you do in this chunk? We haven't talked to Wes or anyone yet, so maybe that will be a to-do for later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants