Skip to content

Soumya03007/FastScribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic RAG

A small-scale PDF-based Retrieval-Augmented Generation (RAG) system designed for correctness, clear separation of concerns, and practical efficiency.

Features

  • Persistent Vector Storage: Uses Pinecone for scalable vector storage
  • Incremental Indexing: Selective reindexing for changed PDFs only
  • Grounded Answer Generation: Pluggable LLM layer with answer grounding
  • Local Caching: SQLite-backed caching to avoid unnecessary LLM calls
  • CLI Interface: Command-line tools for indexing and querying
  • FastAPI API: HTTP endpoints for programmatic access
  • Analytics: Query logging for internal analytics

Architecture

The system follows a clean pipeline: PDF -> chunk -> embed -> Pinecone -> retrieve -> LLM

Components

  1. Ingestion: Loads PDFs from data/, cleans text, splits into chunks
  2. Embedding: Uses sentence-transformers/all-MiniLM-L6-v2 for embeddings
  3. Vector Storage: Pinecone for persistent vector storage
  4. Retrieval: Semantic search over embedded chunks
  5. Generation: LLM-powered answer generation with grounding

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/agentic-rag.git
cd agentic-rag
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your API keys (Pinecone, Google AI, etc.)

Usage

CLI

Index documents:

python -m app.main index

Ask questions:

python -m app.main ask "What is the main topic of the documents?"

API

Start the FastAPI server:

uvicorn app.api:app --reload

The API will be available at http://localhost:8000

Configuration

The system uses pydantic-settings for configuration. Key settings include:

  • Pinecone API key and environment
  • Google AI API key for LLM
  • Embedding model configuration
  • Chunk size and overlap settings

See app/config.py for all available options.

Testing

Run tests:

pytest

Project Structure

app/
├── core/          # Core RAG pipeline components
├── infra/         # Infrastructure (embedding, storage, etc.)
├── utils/         # Utilities (logging, caching, etc.)
├── api.py         # FastAPI application
├── config.py      # Configuration management
├── graph.py       # LangGraph orchestration
└── main.py        # CLI entrypoint

tests/             # Test suite
data/              # PDF documents directory

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

About

FastScribe is a modular system based on agents for retrieval-augmented generation. It converts static PDF content into a reliable knowledge base. Abhidha makes use of Pinecone for permanent embeddings and LangGraph for asking queries and retrieving information. It gives contextual and relevant information with strong references.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages