Git Product home page Git Product logo

Comments (1)

dylanholmes avatar dylanholmes commented on June 3, 2024 2

Hi @qwe321389yfs8t7huqd89q, thanks for surfacing this issue!

I've reproduced this using the following steps:

  1. Started a local redis server with the redis search module:
    docker run -p 6379:6379 redislabs/redisearch:latest
  2. Created an index.
    redis-cli FT.CREATE idx:griptape ON hash PREFIX 1 "griptape:" SCHEMA tag TAG vector VECTOR FLAT 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE
  3. Ran the example, replacing LocalVectorStoreDriver with RedisVectorStoreDriver.

Full Program:

from dotenv import load_dotenv
from griptape.structures import Agent
from griptape.tools import VectorStoreClient, TaskMemoryClient
from griptape.loaders import WebLoader
from griptape.engines import VectorQueryEngine
from griptape.drivers import RedisVectorStoreDriver, OpenAiEmbeddingDriver, OpenAiChatPromptDriver


load_dotenv()

engine = VectorQueryEngine(
    prompt_driver=OpenAiChatPromptDriver(model="gpt-3.5-turbo"),
    vector_store_driver=RedisVectorStoreDriver(
        host="localhost",
        port=6379,
        password="",
        index="idx:griptape",
        embedding_driver=OpenAiEmbeddingDriver(),
    ),
)

engine.upsert_text_artifacts(
    WebLoader().load("https://www.griptape.ai"),
    namespace="griptape"
)

vector_db = VectorStoreClient(
    description="This DB has information about the Griptape Python framework",
    query_engine=engine,
    namespace="griptape"
)

agent = Agent(
    tools=[vector_db, TaskMemoryClient(off_prompt=False)]
)

agent.run(
    "what is Griptape?"
)

Full Output:

[05/15/24 09:14:48] INFO     ToolkitTask 7fded25e6c244321a9233a3badbb4fa6                                                  
                             Input: what is Griptape?                                                                      
[05/15/24 09:14:52] INFO     Subtask 9c9d60f4761d432986781d48fe724a43                                                      
                             Thought: I need to search the vector database for information about the Griptape Python       
                             framework.                                                                                    
                             Actions: [                                                                                    
                               {                                                                                           
                                 "name": "VectorStoreClient",                                                              
                                 "path": "search",                                                                         
                                 "input": {                                                                                
                                   "values": {                                                                             
                                     "query": "What is Griptape Python framework?"                                         
                                   }                                                                                       
                                 },                                                                                        
                                 "tag": "search_griptape"                                                                  
                               }                                                                                           
                             ]                                                                                             
[05/15/24 09:14:53] INFO     Subtask 9c9d60f4761d432986781d48fe724a43                                                      
                             Response: error querying vector store: string indices must be integers, not 'str'             
[05/15/24 09:14:58] INFO     Subtask 71dac42b65464856831bdb342604789d                                                      
                             Thought: There seems to be an error with the way I structured the action. I need to correct   
                             the input format and try again.                                                               
                                                                                                                           
                             Actions: [                                                                                    
                               {                                                                                           
                                 "name": "VectorStoreClient",                                                              
                                 "path": "search",                                                                         
                                 "input": {                                                                                
                                   "values": {                                                                             
                                     "query": "What is Griptape Python framework?"                                         
                                   }                                                                                       
                                 },                                                                                        
                                 "tag": "search_griptape"                                                                  
                               }                                                                                           
                             ]                                                                                             
                    INFO     Subtask 71dac42b65464856831bdb342604789d                                                      
                             Response: error querying vector store: string indices must be integers, not 'str'             
[05/15/24 09:15:05] INFO     Subtask 71d47cb90fe8491184186bb9dd47824a                                                      
                             Thought: The same error occurred again. It seems there might be an issue with the             
                             VectorStoreClient action. I will try to use the TaskMemoryClient action to search the memory  
                             content for information about Griptape.                                                       
                                                                                                                           
                             Actions: [{"tag": "query_griptape", "name": "TaskMemoryClient", "path": "query", "input":     
                             {"values": {"memory_name": "griptape_info", "artifact_namespace": "griptape", "query": "What  
                             is Griptape Python framework?"}}}]                                                            
                    INFO     Subtask 71d47cb90fe8491184186bb9dd47824a                                                      
                             Response: memory not found                                                                    
[05/15/24 09:15:10] INFO     Subtask b760ab6da0f1473685c8bca126477928                                                      
                             Thought: The memory does not contain information about Griptape. I will try to summarize the  
                             memory content to see if there is any relevant information.                                   
                             Actions: [{"tag": "summarize_memory", "name": "TaskMemoryClient", "path": "summarize",        
                             "input": {"values": {"memory_name": "griptape_info", "artifact_namespace": "griptape"}}}]     
                    INFO     Subtask b760ab6da0f1473685c8bca126477928                                                      
                             Response: memory not found                                                                    
[05/15/24 09:15:15] INFO     ToolkitTask 7fded25e6c244321a9233a3badbb4fa6                                                  
                             Output: I'm sorry, but I am currently unable to provide information about Griptape.           

from griptape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.