Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.45k stars 44.06k forks source link

How can I make Auto-GPT access local files on my computer, such as PDF and TXT files? #1930

Closed chengxinzhaox closed 12 months ago

chengxinzhaox commented 1 year ago

I have tried many methods, such as uploading the file to a public repository on GitHub or sharing it on Google Drive, but Auto-GPT still cannot access it.

Qoyyuum commented 1 year ago

You can put them in the autogpt_workspace folder

chengxinzhaox commented 1 year ago

Thank you for your response! I put three PDF files into the autogpt_workspace folder, but its initial reaction is still to go to the browser to search. How can I make it aware that it should go to the autogpt_workspace folder to access the files? Can you give me an example? Thank you very much!

Explorergt92 commented 1 year ago

@ChesterZhao Set one of your goals to something like "read and review the file <your-file-name> in the workspace folder" and put the file you want it to read in Auto-GPT/auto_gpt_workspace

SargeDGz commented 1 year ago

re read the readme specifically the Data Ingestion part

finster869 commented 1 year ago

I have two files in the auto_gpt_workspace file pb.txt and db.txt. If I ask the AI in the goals to read and summarize both files it finds them and does so. I have also placed those same files in a subfolder "seed_data" in the auto_gpt_workspace folder. I am using pinecone, so after autogpt is running I am able to successfully run data_ingestion.py and it tells me the information has been ingested. How do I let the AI know that db.txt and pb.txt have been ingested to memory? When it begins processing its commands, the first task it assigns itself is to locate the files pb.txt and db.txt meaning it doesn't know they have been ingested.

chengxinzhaox commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

finster869 commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

chengxinzhaox commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

ofcourse~

chengxinzhaox commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

finster869 commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

ofcourse~

Did you indicate in one of the goals for the AI that you want it to read the "xxxxx.txt" file? That is how I do it. If it can't find the file, it then usually automatically searches for itself and finds it.

I can get it to read the text files without issue from the machine. IN contrast, although it gives me a message indicating that the files have been ingested after I run data_ingestion.py, it still searches for them and doesn't seem to realize the information is in its memory.

finster869 commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

From what directory are you running autogpt?

chengxinzhaox commented 1 year ago

How to fix this: SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory. I already set the EXECUTE_LOCAL_COMMANDS=True

Did you put the file you want read in the auto_gpt_workspace folder? It needs to be in that folder.

but it's not working, SYSTEM: Command read_file returned: Error: Attempted to access outside of working directory.

From what directory are you running autogpt?

yes

nayrmot commented 1 year ago

I am getting an error " Command search_files returned: Error: 'WindowsPath' object has no attribute 'is_relative_to'"

How do I resolve this error?

willmoura commented 1 year ago

I'm getting this error "SYSTEM: Command read_file returned: Error: 'utf-8' codec can't decode byte 0xe2 in position 10: invalid continuation byte" How do I resolve it?

Nick-Bravante commented 1 year ago

I'm getting this error "SYSTEM: Command read_file returned: Error: 'utf-8' codec can't decode byte 0xe2 in position 10: invalid continuation byte" How do I resolve it?

I am having this same issue. The system is saying SYSTEM: Command evaluate_code returned: "Error: The model: gpt-4 does not exist". Could running 3.5 and not 4 be the issue?

magamagaman1 commented 1 year ago

Same issue here. My AI isn't able to read pdf files . It always gives me : Command read_file returned: Error: 'utf-8' codec can't decode byte 0xb5 in position 11: invalid start byte . I already installed PyPDF2 and told it to use it and it still doesn't read them. My goal for it is to have it read and learn from pdf files.

interzone2 commented 1 year ago

@magamagaman1 - I think we need to convert PDF to .txt files for this to work.

BUT

Why does autogpt look here for local files: /home/appuser/auto_gpt_workspace/ - this does not correspond to my file structure, there's no appuser directory ?

magamagaman1 commented 1 year ago

Appuser is the user that is used when you run autogpt in a docker and a local folder is mapped into the docker. Converting pdf files to text is tedious . I have many files that I would like the ai to learn from and I am sure that we should be able to use something like PyPDF2 but even while I have installed it, the AI will not use to read the pdf file. Hope others will see this post and will help get this feature working. Thanks for your help.

On Tue, Apr 25, 2023, 1:12 AM interzone2 @.***> wrote:

@magamagaman1 https://github.com/magamagaman1 - I think we need to convert PDF to .txt files for this to work.

BUT

Why does autogpt look here for local files: /home/appuser/auto_gpt_workspace/ - this does not correspond to my file structure, there's no appuser directory ?

— Reply to this email directly, view it on GitHub https://github.com/Significant-Gravitas/Auto-GPT/issues/1930#issuecomment-1521206073, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU7JWDQTR3REDGFII6GDZ2LXC5TNNANCNFSM6AAAAAAXAGVYHI . You are receiving this because you were mentioned.Message ID: @.***>

edwardliufirm commented 1 year ago

Same issue here. My AI isn't able to read pdf files . It always gives me : Command read_file returned: Error: 'utf-8' codec can't decode byte 0xb5 in position 11: invalid start byte . I already installed PyPDF2 and told it to use it and it still doesn't read them. My goal for it is to have it read and learn from pdf files.

I went through a same process and it's still not working.

interzonez commented 1 year ago

Thanks for the replies.

I did manage to get someplace with Langchain and memory for querying texts by going through their notebooks. It's quite simple. Therefore I'm not sure what is causing the breakage in AutoGPT. Once content has been ingested it should be relatively simple to have GPT take it on board. Of course there are varying levels of complexity. Asking questions of a document is one thing. But I want GPT to go off and perform other tasks WITH this memory activated so that it may use this knowledge to get further along with a problem. Will keep on digging.

https://python.langchain.com/en/latest/use_cases/summarization.html

XChikuX commented 1 year ago

How large can a document be in the workspace folder?

Can I give it a 700 page book?

avaneeshkum commented 1 year ago

@XChikuX yes - for me it hanged, I believe you can integrate a SQLdb or pandas agent.

XChikuX commented 1 year ago

@avaneeshkum Do you happen to know what size document would work without the agent?

avaneeshkum commented 1 year ago

Last, I used an 800-page book, and it could load it. That was just embeddings and query the doc framework in langchain.

shivvem commented 1 year ago

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace.

File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args a = os.fspath(a) ^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not NoneType

Kumaava commented 1 year ago

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace.

File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args a = os.fspath(a) ^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not NoneType

Please keep files in autogpt workspace.

shivvem commented 1 year ago

re read the readme specifically the Data Ingestion part

I have carefully read the instructions. I am using the data_ingestion.py correctly I believe. Yet I get this error, when I try to read my documents placed in auto_gpt_workspace. File "C:\Users\shivv\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 493, in _parse_args a = os.fspath(a) ^^^^^^^^^ TypeError: expected str, bytes or os.PathLike object, not NoneType

Please keep files in autogpt workspace.

Sorry, but I am getting the same error over and over again. I have tried putting my files (which I want ingested) at multiple places. None of them work. I tried putting at: Auto-GPT\autogpt Auto-GPT\autogpt\auto-gpt-workspace Auto-GPT\autogpt\workspace

glicerico commented 1 year ago

I was having the same problem with a txt file.

TL;DR: In your docker-compose.yaml file, change:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

to

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

A bit longer answer:

I noticed that the command that AutoGPT v0.3.0 was proposing was:

NEXT ACTION:  COMMAND = read_file ARGUMENTS = {'filename': '/app/autogpt/auto_gpt_workspace/minireport_CMST_CRFAE.txt'}

The path looked different from the declared volume in the docker-compose.yaml file:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

So I added the missing dir, to make sure the directory is mounted where AutoGPT looks for it.

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

And that worked!

shivvem commented 1 year ago

I was having the same problem with a txt file.

TL;DR: In your docker-compose.yaml file, change:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

to

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

A bit longer answer:

I noticed that the command that AutoGPT v0.3.0 was proposing was:

NEXT ACTION:  COMMAND = read_file ARGUMENTS = {'filename': '/app/autogpt/auto_gpt_workspace/minireport_CMST_CRFAE.txt'}

The path looked different from the declared volume in the docker-compose.yaml file:

    volumes:
      - ./auto_gpt_workspace:/app/auto_gpt_workspace

So I added the missing dir, to make sure the directory is mounted where AutoGPT looks for it.

    volumes:
      - ./auto_gpt_workspace:/app/autogpt/auto_gpt_workspace

And that worked!

Thanks for your inputs! For me though, I don't use Docker. I have sort of given up on AutoGPT by now. There are too many raw edges to this .. which is fine as this is a product under development.

bdaoud90 commented 1 year ago

Hey all, I have a question about PDFs. Does anyone's prompts immediately start directing to finding a converter? can it not read the PDFs natively?

github-actions[bot] commented 1 year ago

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] commented 12 months ago

This issue was closed automatically because it has been stale for 10 days with no activity.