# pdfRAGtool not finding pdfs

**URL:** <https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814>\
**Category:** CrewAI Community Support\
**Created:** [October 15, 2024, 6:06pm UTC](https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814 "2024-10-15T18:06:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Casillas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/ruben_casillas/32/439_2.png) [@Ruben\_Casillas](https://community.crewai.com/u/Ruben_Casillas)\
**Post date:** [October 15, 2024, 6:06pm UTC](https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814/1 "2024-10-15T18:06:57Z")

</div>

Hi there,

Is there a special folder or method to add the pdfs?  
Like only accepting absolute paths? or have to get into a folder first?  
Also, I see that Langchain is the one embedding the documents, but I asked to do it with an ollama text embedding model.

I also see that my tokens in Langchain ran out and I would like to use a local solution.  
My pdftool looks like this:

```auto

PDFtool = PDFSearchTool(
    config=dict(
        llm=dict(
            provider="ollama",# or google, openai, anthropic, llama2, ...
            config=dict(
                model="llama3.1",
                temperature=0.01,
                base_url='http://127.0.0.1:11434',),),
        embedder=dict(
            provider="ollama",# or openai, ollama, ...
            config=dict(
                model="nomic-embed-text:latest",
                base_url='http://127.0.0.1:11434',
                # title="Embeddings",
            ),
        ),
    )
)

```

and my outputs are:

```auto
I encountered an error while trying to use the tool. This was the error: File path /path/to/Ruben_Casillas.CV.pdf is not a valid file or url.
 Tool Search a PDF's content accepts these inputs: Search a PDF's content(query: 'string', pdf: 'string') - A tool that can be used to semantic search a query from a PDF's content. query: 'Mandatory query you want to use to search the PDF's content', pdf: 'Mandatory pdf path you want to search'

```

can some one tell me what am I doing wrong and if there is a possibility to avoid using langchain.

Many thanks and greetings.

---

<div class="post-metadata">

**Author:** ![moto](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@moto](https://community.crewai.com/u/moto)\
**Post date:** [October 15, 2024, 7:46pm UTC](https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814/2 "2024-10-15T19:46:34Z")

</div>

I think here it is api\_base= rather than base\_url=  
not sure but take a look at the docs.

If it did make the call to the tool, it looks like it was an llm problem trying to formulate the call to the tool correctly. maybe not capable enough.

On the tool instantiation, if you are looking at a specific pdf, are you adding

```auto
pdf='path/to/your/document.pdf' parameter to the instantiation you show above?
```

---

<div class="post-metadata">

**Author:** ![ScarletAI](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/scarletai/32/47_2.png) [@ScarletAI](https://community.crewai.com/u/ScarletAI)\
**Post date:** [October 15, 2024, 10:50pm UTC](https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814/3 "2024-10-15T22:50:09Z")

</div>

Hey Ruben,

I use the file read tool often with my agents which is a little different, but try this:

file\_read\_tool = FileReadTool(file\_path=‘memory.txt’)

# Define agents

architect\_agent = Agent(  
role=‘Architect Agent’,  
goal=f’Design a fully self-contained AI crew focused on {topic} with all agents, tasks, and tools within main.py.',  
verbose=True,  
memory=True,  
llm=ChatOpenAI(model\_name=“gpt-4o-mini”), # Updated to use gpt-4o-mini  
backstory=(  
"As an experienced architect within CrewAI, the Architect Agent specializes in creating modular, "  
“self-contained AI systems. This agent excels in blueprinting AI systems that are flexible and efficient.”  
),  
tools=[file\_read\_tool]

I drop the file I would like the agents to look at in the project folder and it works fine.

Let me know if it works 🙂

---

<div class="post-metadata">

**Author:** ![Ruben\_Casillas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/ruben_casillas/32/439_2.png) [@Ruben\_Casillas](https://community.crewai.com/u/Ruben_Casillas)\
**Post date:** [October 16, 2024, 5:54pm UTC](https://community.crewai.com/t/pdfragtool-not-finding-pdfs/814/4 "2024-10-16T17:54:32Z")

</div>

I want to thank you both for the answers.  
It was actually to modify the model name, as it came with “:lastest” at the end

Many thanks!!
