-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ai features docs #88
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
Conversation
Reviewer's Guide by SourceryThis PR adds comprehensive documentation for AI features in SettleMint, specifically focusing on how to implement OpenAI nodes and pgvector in Hasura. The documentation provides a detailed, step-by-step guide for creating AI-powered workflows that handle data vectorization and similarity searches. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughA new documentation file named Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Hey @robbeverhelst - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a direct link to the 'Getting Started Guide' in the introduction section for easier navigation.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟡 Documentation: 3 issues found
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
docs/developer-guides/ai-features.md
Outdated
|
|
||
| ### Step 1: Set Up Vector Storage in Hasura | ||
|
|
||
| 1. Access your SettleMints Hasura instance through the admin console. |
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.
issue (documentation): Fix typo in 'SettleMints' - should be 'SettleMint's'
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (5)
docs/developer-guides/ai-features.md (5)
8-14: Add OpenAI API key requirement to the introduction.
The introduction should mention that users need an OpenAI API key to use these features, as it's a critical prerequisite for the OpenAI nodes to function.
In this guide, you will learn to create workflows that:
- Use **OpenAI nodes** to vectorize data.
- Store vectorized data in **Hasura** using `pgvector`.
- Conduct similarity searches to find relevant matches for new queries.
+
+> **Note**: You'll need an OpenAI API key to use the OpenAI nodes. You can obtain one from the [OpenAI platform](https://platform.openai.com/).15-19: Add version requirements to prerequisites.
To prevent compatibility issues, specify the minimum required versions of Integration Studio and Hasura.
### Prerequisites
- A SettleMint Platform account with **Integration Studio** and **Hasura** deployed
+ - Integration Studio version 2.0 or higher
+ - Hasura version 2.25 or higher with pgvector extension enabled
- Access to the Integration Studio and Hasura consoles in your SettleMint environment
- A data source to vectorize (e.g., Graph Node, Attestation Indexer, or external API endpoint)64-71: Add error handling to GraphQL mutation example.
The mutation example should include error handling to help users debug issues.
mutation insertVector($id: uuid!, $vector: [Float!]!) {
insert_vectors(objects: {id: $id, vector: $vector}) {
affected_rows
+ returning {
+ id
+ }
+ # Add error handling
+ __typename
}
}114-120: Specify distance metric and add response format example.
The vector search query should specify the distance metric and include an example of the expected response format.
query searchVectors($vector: [Float!]!) {
vectors(
order_by: {vector: {_vector_distance: $vector}},
+ # Specify distance metric (cosine similarity)
+ vector_distance_metric: "cosine",
limit: 5
) {
id
vector
+ distance
}
}Add example response:
{
"data": {
"vectors": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"distance": 0.123
}
]
}
}157-163: Add community support channels and versioned documentation links.
Consider adding:
- SettleMint community support channels
- Version-specific documentation links to prevent broken references
For further resources, check out:
- [SettleMint Integration Studio Documentation](https://console.settlemint.com/documentation/docs/using-platform/integration-studio/)
- [Node-RED Documentation](https://nodered.org/docs/)
- [OpenAI API Documentation](https://beta.openai.com/docs/)
- [Hasura pgvector Documentation](https://hasura.io/docs/3.0/connectors/postgresql/native-operations/vector-search/)
+- [SettleMint Community Forum](https://community.settlemint.com)
+- [SettleMint Discord Server](https://discord.gg/settlemint)📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
static/img/developer-guides/openai-node.pngis excluded by!**/*.png
📒 Files selected for processing (1)
- docs/developer-guides/ai-features.md (1 hunks)
🔇 Additional comments (1)
docs/developer-guides/ai-features.md (1)
1-6: LGTM! Well-structured metadata section.
The metadata section includes all necessary fields and relevant keywords for documentation indexing.
| 2. Create a new table called `document_embeddings` with the following columns: | ||
| - `id` (type: UUID, primary key) | ||
| - `embedding` (type: vector(1536)) - For storing OpenAI embeddings | ||
|
|
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.
Add vector index creation step for performance.
The table creation instructions should include creating an index for vector similarity searches to optimize query performance.
2. Create a new table called `document_embeddings` with the following columns:
- `id` (type: UUID, primary key)
- `embedding` (type: vector(1536)) - For storing OpenAI embeddings
+
+ 3. Create an index for vector similarity search:
+ ```sql
+ CREATE INDEX ON document_embeddings
+ USING ivfflat (embedding vector_cosine_ops)
+ WITH (lists = 100);
+ ```
Summary by Sourcery
Documentation:
Summary by CodeRabbit
New Features
Documentation
ai-features.mddetailing workflows for data vectorization and similarity searches using OpenAI and Hasura, including setup instructions and advanced use cases.