-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(kb): Adding support for more tags to the KB #2433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
- Update base-tags-modal with field type selector dropdown - Update document-tags-modal with different input types per fieldType - Update knowledge-tag-filters with operator dropdown and type-specific inputs - Update search routes to support all tag slot types - Update hook to use AllTagSlot type
- Add dropdown with all field types (Text, Number, Date, Boolean) - Render different value inputs based on field type - Update slot counting to include all field types (28 total)
- Replace MAX_TAG_SLOTS with totalSlots in document-tag-entry - Add z-index to SelectContent in base-tags-modal for proper layering
- Only apply empty string check for text columns (tag1-tag7) - Numeric/date/boolean columns only check IS NOT NULL - Cast values to text for consistent output
- Replace @/components/ui imports with @/components/emcn - Use Combobox instead of Select for dropdowns - Use EMCN Switch, Button, Input, Label components - Remove unsupported 'size' prop from EMCN Button
- Change delete button from absolute to inline positioning - Add proper column width (w-10) for delete button - Add empty header cell for delete column - Apply fix to both document-tag-entry and knowledge-tag-filters
- Reset value to empty when changing type (e.g., boolean to text) - Reset value when tag name changes and type differs - Prevents 'true'/'false' from sticking in text inputs
…arch - Copy all tag types (number, date, boolean) from document to embedding records - Update processDocumentTags to handle all field types with proper type conversion - Add number/date/boolean columns to document queries in checkDocumentWriteAccess - Update chunk creation to inherit all tag types from parent document - Add getSearchResultFields helper for consistent query result selection - Support structured filters with operators (eq, gt, lt, between, etc.) - Fix search queries to include all 28 tag fields in results
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@Pbonmars-20031006 also don't forget to generate the migration using bunx drizzle-kit generate to the sql, snapshot, etc shows up [you can do that before me merge] |
|
@Pbonmars-20031006 build failing here Also, we realized that the write speed would become really slow if we have this many indices. Can we have 3 for number and 2 for date. And for text have more filters like "contains" and "starts with" if they have equivalent sql ops -- e.g. https://stackoverflow.com/questions/1069302/using-the-star-sign-in-grep |
Greptile SummaryThis PR extends the knowledge base tagging system to support multiple field types (number, date, boolean) in addition to the existing text tags. The implementation adds 10 new database columns (5 number, 2 date, 3 boolean) to both Key Changes:
Technical Highlights:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant UI as Tag Filters UI
participant API as Search API
participant TagSvc as Tag Service
participant DocSvc as Document Service
participant DB as Database (Postgres)
Note over User,DB: Tag Definition Creation
User->>UI: Create tag definition (name, fieldType)
UI->>TagSvc: createTagDefinition()
TagSvc->>TagSvc: getNextAvailableSlot(fieldType)
TagSvc->>DB: INSERT knowledgeBaseTagDefinitions
DB-->>TagSvc: Tag definition created
TagSvc-->>UI: Success
Note over User,DB: Document Upload with Tags
User->>DocSvc: Upload document with tags
DocSvc->>DocSvc: processDocumentTags(tagData)
DocSvc->>TagSvc: getDocumentTagDefinitions()
TagSvc-->>DocSvc: Tag definitions with fieldType
DocSvc->>DocSvc: Type conversion (string→number/date/boolean)
DocSvc->>DB: INSERT document with typed tag values
DB-->>DocSvc: Document created
DocSvc->>DocSvc: Generate embeddings
DocSvc->>DB: INSERT embeddings (inherit typed tags)
DB-->>DocSvc: Embeddings created
Note over User,DB: Search with Structured Filters
User->>UI: Configure filter (tag, operator, value)
UI->>API: POST /api/knowledge/search<br/>{tagFilters: [{tagName, fieldType, operator, value}]}
API->>TagSvc: getDocumentTagDefinitions()
TagSvc-->>API: Map tagName → tagSlot + fieldType
API->>API: Build structured filters
API->>DB: SELECT with operator-based WHERE<br/>(eq, gt, contains, between, etc.)
DB-->>API: Filtered results
API->>API: Map tagSlots → displayNames
API-->>UI: Results with typed tag values
UI-->>User: Display search results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
24 files reviewed, 3 comments
Summary
Adding more KB tag types + filters.
Type of Change
Testing
Tested Manually.
Checklist