Files
rag-agent-task/README.md
T
2026-05-25 10:56:46 +00:00

31 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Simple RAG Agent
This repository contains a simple Retrieval-Augmented Generation (RAG) agent implemented with **LangChain** and **OpenAI** embeddings. It demonstrates how to build a questionanswering system that retrieves relevant documents from a local vector store and generates answers using OpenAIs GPT model.
## Features
- **Document ingestion**: Load text files and create embeddings.
- **Vector store**: Uses FAISS as the local vector store.
- **Retriever**: Retrieves topk relevant documents for a user query.
- **LLM wrapper**: Uses OpenAI GPT3.5Turbo or GPT4.
- **Prompt template**: Combines retrieved context with the user question.
- **Simple CLI**: Interact with the agent from the command line.
## Installation
```bash
pip install -r requirements.txt
```
## Usage
```bash
python rag_agent.py --data_dir path/to/documents --query "What is the capital of France?"
```
The agent will print the generated answer.
## Dependencies
All required packages are listed in `requirements.txt`.