Skip to content

Conversation

@tourtourigny
Copy link
Contributor

@tourtourigny tourtourigny commented Jun 5, 2025

Add new tools for MCP server to query the knowledge graph

Modified: get_entity_info

  • Shows relations inbound and outbound
  • Shows attributes
  • Resolves most attributes and relation id to their name

Added: search_relation_between_2_entities

  • Get the relation(s) that are between 2 entities and the path of these relations

Added: get_entity_by_attribute

  • search in natural language for an attribute of entity

new function for resolving Id of entity to their name

embeddings are now available for the sample data

image

image

@tourtourigny tourtourigny requested a review from cvauclair June 5, 2025 20:38
Copy link
Contributor

@cvauclair cvauclair left a comment

Choose a reason for hiding this comment

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

Nice work! Small thing to change but apart from that it looks good to merge

}
}

impl<T: FromAttributes> Query<Vec<Relation>> for FindPathQuery<T> {
Copy link
Contributor

Choose a reason for hiding this comment

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

In queries that return data, the generic type T is used to indicate what shape of data will be returned. However, since here were returning a "hardcoded" Vec<Relation> as the data, we don't actually need T.

There are two possible fixes:

  1. (recommended) Change the impl to impl Query<Vec<Relation>> for FindPathQuery<Vec<Relation>>
  2. Remove T from FindPathQuery (not ideal since we might want to support more return types in the future)

skip: Option<usize>,
space_id: Option<PropFilter<String>>,
version: VersionFilter,
_phantom: std::marker::PhantomData<EntityNode>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since FindPathQuery does not have a generic type parameter anymore, we don't need to have a _phantom field!

Copy link
Contributor

@cvauclair cvauclair left a comment

Choose a reason for hiding this comment

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

Nice work!

@cvauclair cvauclair merged commit 8ef41bb into main Jun 10, 2025
4 checks passed
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