HomeGuidesAPI ReferenceRelease notes
Log In
Guides

Knowledge tool

SWE now enables you to boost your application by creating a tool that allows it to directly query your pre-created knowledge base within Superwise. For setup and indexing guidance, refer to pre-created Knowledge. This integration enhances your application's responsiveness and enriches user experience

Using the UI

Step 1: Add the Knowledge tool

Click on the "+ Tool" button, and then SW Knowledge"

Step 2: Configure the tool

  • Assign a meaningful name to the tool. This name will help the model understand the context in which the data will be used.
  • Add a description: Provide a thorough description of the database and its use. This information assists the model in contextualizing the data and influences the prompts generated by the system.
  • Select your pre created knowledge

Using the SDK

  • Assign a meaningful name to the tool. This name will help the model understand the context in which the data will be used.
  • Add a description: Provide a thorough description of the database and its use. This information assists the model in contextualizing the data and influences the prompts generated by the system.
  • Use your pre created knowledge object to create the knowledge tool
  • Add the tool to your application
from superwise_api.models.tool.tool import ToolDef
from superwise_api.models.tool.tool import ToolConfigKnowledge
from superwise_api.models.application.application import AdvancedAgentConfig

knowledge = sw.knowledge.get_by_id(knowledge_id="knowledge_id") 

knowledge_tool = ToolDef(name="Name",
                         description="Description",
                         config=ToolConfigKnowledge(knowledge_id=str(knowledge.id),
                                                    knowledge_metadata=knowledge.knowledge_metadata,
                                                    embedding_model=knowledge.embedding_model))

app = sw.application.put(str(app.id), 
                         additional_config=AdvancedAgentConfig(tools=[knowledge_tool]),
                         llm_model=llm_model, 
                         prompt=None, 
                         name="Application name",
                         show_cites = True
                        )