sim icon indicating copy to clipboard operation
sim copied to clipboard

feat(kb): Adding support for more tags to the KB

Open Pbonmars-20031006 opened this issue 2 months ago • 4 comments

Summary

Adding more KB tag types + filters.

Type of Change

  • [x] New feature

Testing

Tested Manually.

Checklist

  • [x] Code follows project style guidelines
  • [x] Self-reviewed my changes
  • [x] Tests added/updated and passing
  • [x] No new warnings introduced
  • [x] I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Pbonmars-20031006 avatar Dec 17 '25 23:12 Pbonmars-20031006

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 20, 2025 4:57am

vercel[bot] avatar Dec 17 '25 23:12 vercel[bot]

@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]

icecrasher321 avatar Dec 18 '25 01:12 icecrasher321

@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

icecrasher321 avatar Dec 18 '25 19:12 icecrasher321

Greptile Summary

  • Extends knowledge base tagging system to support typed tags (number, date, boolean) beyond text tags with structured filtering capabilities including operators like equals, greater than, between, and contains
  • Adds comprehensive database schema changes with typed columns (number1-5, date1-2, boolean1-3) and corresponding indexes to both document and embedding tables
  • Implements new UI components including DatePicker, structured filter interfaces, and type-specific input controls for managing the enhanced tagging system

Important Files Changed

Filename Overview
packages/db/migrations/0126_dapper_midnight.sql Database migration adding typed tag columns (number, date, boolean) to document/embedding tables with indexes for filtering
apps/sim/lib/knowledge/constants.ts Schema mismatch - hardcodes 5 number/2 date/3 boolean slots but database migration creates7 of each type
apps/sim/lib/knowledge/filters/query-builder.ts Comprehensive query builder for typed tag filtering with SQL generation, but slot validation conflicts with database schema
apps/sim/lib/knowledge/documents/service.ts Breaking changes to processDocumentTags function signature and return type, requires existing tag definitions

Confidence score: 2/5

  • This PR requires careful review due to critical schema inconsistencies that will cause runtime failures
  • Score lowered due to hardcoded slot count mismatches between constants (5,2,3) and database migration (7,7,7 for each type), breaking changes in service functions, and potential type safety issues where validation logic conflicts with database schema
  • Pay close attention to schema files, constants definitions, and query builder validation logic to resolve slot count inconsistencies

greptile-apps[bot] avatar Dec 18 '25 21:12 greptile-apps[bot]

@greptile

icecrasher321 avatar Dec 20 '25 04:12 icecrasher321

@greptile

icecrasher321 avatar Dec 20 '25 04:12 icecrasher321