FAQ agent for answering questions from an indexed PDF.
flowchart LR
U([User]) -->|question| A
subgraph A[Agent]
P[System Prompt\nFAQ assistant] --> T[search_pdf_knowledge\ntool]
end
T -->|query| R[(FAISS index\n+ PDF chunks)]
R -->|relevant snippets| T
T --> P
P -->|answer + page refs| U
faq-pdf-agent/
├── app/ # Core agent code
│ ├── agent.py # Main agent logic
│ ├── pdf_knowledge.py # Local PDF index search tool
│ ├── fast_api_app.py # FastAPI Backend server
│ └── app_utils/ # App utilities and helpers
├── data/
│ ├── pdfs/ # Put source PDFs here
│ └── knowledge/ # Generated JSON index
├── scripts/
│ └── ingest_pdf.py # PDF ingestion script
├── tests/ # Unit, integration, and load tests
├── AGENTS.md # AI-assisted development guide
└── pyproject.toml # Project dependencies
Before you begin, ensure you have:
- uv: Python package manager (used for all dependency management in this project) - Install (add packages with
uv add <package>) - agents-cli: Agents CLI - Install with
uv tool install google-agents-cli - Google Cloud SDK: For GCP services - Install
Install agents-cli and its skills if not already installed:
uvx google-agents-cli setupInstall required packages:
agents-cli installPlace your source PDF under data/pdfs/, then build the local index:
uv run python scripts/ingest_pdf.py data/pdfs/your-file.pdfTest the agent with a local web server:
agents-cli playground