Skip to content

Repository files navigation

faq-pdf-agent

FAQ agent for answering questions from an indexed PDF.

Architecture

Architecture Diagram

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
Loading

Project Structure

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

Requirements

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

Quick Start

Install agents-cli and its skills if not already installed:

uvx google-agents-cli setup

Install required packages:

agents-cli install

Place your source PDF under data/pdfs/, then build the local index:

uv run python scripts/ingest_pdf.py data/pdfs/your-file.pdf

Test the agent with a local web server:

agents-cli playground

About

SImple custom RAG for vector search to semantically search over pdf files

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages