-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor #72
Comments
You're on the right track! Separating tools can definitely improve the readability of your agent package, especially when it comes to the semantic search agent. Let's dive into how you can achieve this. First, let's understand the current structure of the semantic search agent. It's currently a single function called To enhance readability and maintainability, you can separate the semantic search agent into multiple functions, each responsible for a specific task. Here's a possible approach:
By following these steps, you'll have a more modular and readable semantic search agent. Here's an example of how the // semantic_search/semantic_search.go
// ... (other code)
func GetVectorStore(storeName string) (embeddings.VectorStore, error) {
// ... (logic to retrieve the vector store based on storeName)
}
func PerformSemanticSearch(query string, maxResults int, store embeddings.VectorStore) ([]embeddings.SearchResult, error) {
// ... (logic to perform the semantic search using the vector store)
}
func FormatSearchResults(searchResults []embeddings.SearchResult) string {
// ... (logic to format the search results)
}
// ... (other code) Now, the agent package can call these functions from the |
I am looking for a way to enchance agent package, particularly semantic search agent. Is there way to increase it's readability? I thought that maybe separating tools would be a good idea?
The text was updated successfully, but these errors were encountered: