Quick Start
1
Install Package
Install PraisonAI Agents with PDF chat support:
2
Set API Key
Set your OpenAI API key:
3
Create Script
Create a new file
chat_with_pdf.py:PDF Processing and Chat Agents
PDF processing involves indexing the document content for efficient retrieval during chat.
Advanced Configuration
For more control over the knowledge base, you can specify a configuration:Multi-Agent Knowledge System
For more complex scenarios, you can create a knowledge-based system with multiple agents:How It Works
The user uploads a PDF and asks a question; the agent retrieves the most relevant chunks from the vector store and answers from them.Understanding PDF Chat Agents
What are PDF Chat Agents?
PDF Chat agents enable:
- Natural conversation with PDF documents
- Intelligent information extraction
- Context-aware document understanding
- Quick answers to document-specific questions
Features
PDF Processing
Process and index PDF documents efficiently.
Natural Chat
Have natural conversations about PDF content.
Smart Retrieval
Intelligently retrieve relevant information from PDFs.
Context Awareness
Maintain context throughout the conversation.
Troubleshooting
PDF Issues
If PDF processing isn’t working:
- Check PDF file format and encoding
- Verify document accessibility
- Enable verbose mode for debugging
Chat Issues
If chat responses aren’t accurate:
- Check PDF indexing quality
- Verify question clarity
- Monitor context retention
Best Practices
Install the knowledge extra
Install the knowledge extra
Run
pip install "praisonaiagents[knowledge]" before indexing PDFs. Core install alone lacks Chroma and document parsers needed for retrieval.Use text-searchable PDFs
Use text-searchable PDFs
Scanned image-only PDFs index poorly. Prefer native text PDFs or run OCR upstream so chunking and embedding capture meaningful content.
Pin a persistent vector store path
Pin a persistent vector store path
Set
path and collection_name in your Chroma config so re-indexing does not wipe prior embeddings between restarts.Keep queries specific to the document
Keep queries specific to the document
Ask about sections, figures, or claims in the PDF rather than open-ended prompts — retrieval quality depends on query–chunk alignment.
Next Steps
AutoAgents
Learn about automatically created and managed AI agents
Mini Agents
Explore lightweight, focused AI agents
For optimal chat experience, ensure your PDFs are properly formatted and text-searchable.
Related
Give agents a searchable knowledge base from your documents.
Retrieve relevant chunks from large document sets at query time.

