Catalog facts for agent memory - #330
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| .help("Environment the catalog belongs to") | ||
| .action(ArgAction::Set); | ||
|
|
||
| Command::new("facts") |
There was a problem hiding this comment.
facts has a specific meaning when it comes to data analytics so I would presume this command name is confusing to both humans(like me :D) and ai. Perhaps a better name is meta or ai-context
There was a problem hiding this comment.
Yeah maybe we want to disambiguate this from fact tables in a data warehousing context. I'll take a quick look at this.
`facts` collides with fact tables in dimensional modeling — confusing right where this lives, on a data catalog. Rename the CLI surface and tower-cmd internals to `knowledge`. The generated tower-api client still calls them `facts` since the backend is unchanged.
Resolves the conflict in catalogs.rs, which was entirely in that one file. Two things had landed on develop since this branch was cut. #329 added the `--full` overview to `catalogs show`, which this branch also carries its own copy of, and #331 moved the DuckDB plumbing out into the tower-duckdb crate. The overlap on `--full` is what made the conflict large: the same feature existed on both sides. Resolved by taking develop's catalogs.rs and re-applying only what is unique to this branch, the `knowledge` command and its helpers, rather than hand-merging hunks of duplicated work. So the `--full` implementation is develop's, which is the version that was reviewed and merged and has since been through the tower-duckdb refactor; `run_duckdb_query` and `duckdb_value_to_json` are gone from this file because they now live in tower-duckdb, and their tests moved with them; and `knowledge` is unchanged from this branch, with all eleven of its tests restored. Verified: 112 tests pass (develop's 101 plus this branch's 11), `catalogs knowledge` and `catalogs query --max-rows` both work in the built binary, and catalogs.rs has no clippy warnings.
This PR integrates catalog facts from the API into the CLI to give agents memory about data stored in a catalog. This is just an experimental feature to see how it improves (or not) workloads.
Example