Live preview
EveOutput will stream here when you run the agent.
Summary
The Chat with PDF Agent lets you ask questions about a PDF and get answers grounded in the document, with a page citation for every claim. It indexes the PDF into a vector store, retrieves only the relevant chunks per question, and can also generate comprehension quizzes from real passages. Reach for it to turn manuals, papers, and reports into something you can query.
Install
$ pnpm dlx shadcn@latest add @agentcn/eve/chat-with-pdf
Composition
agent/
├── agent.ts # Agent definition (model + config)
├── instructions.md # Retrieval-grounded answering instructions
├── lib/
│ └── vector-store.ts # libSQL vector store + embeddings helpers
└── tools/
├── index_pdf.ts # Chunk, embed, and store a PDF
└── search_docs.ts # Retrieve relevant chunks for a queryCustomization
- Swap the vector store.
lib/vector-store.tswraps libSQL — replace it with Pinecone, Qdrant, Chroma, or pgvector behind the sameupsertChunks/searchfunctions. - Tune chunking. Adjust
chunkText's size and overlap for your documents. - Swap the embedding model. Change the model in
lib/vector-store.ts. - Add quizzes. The instructions already support quiz generation from retrieved passages — extend them with your preferred format.