DAMG 7245 – Fall 2025 – Binary Insights
Automates the parsing, chunking, embedding, retrieval, and structured-note generation of financial concepts from the Financial Toolbox User’s Guide (fintbx.pdf).
Powered by Apache Airflow, OpenAI GPT-4o, Docling, LangChain, Pinecone, and AWS S3, all containerized and orchestrated on AWS EC2 (Docker Host) (Assignment 3 – Project AURELIA, n.d.).
The pipeline integrates:
- PDF Parsing & Chunking
- Semantic Embedding (OpenAI)
- Vector Search (Pinecone)
- Wikipedia Fallback
- Structured Note Generation (Instructor/OpenAI)
- Caching (PostgreSQL)
- Frontend (Streamlit)
- Orchestration (Airflow)
- Python 3.9+
- PostgreSQL (local or cloud)
- Pinecone account and index
- OpenAI API key
- All required Python packages (see
requirements.txtorrequirements-docling.txt) .envfile with all secrets and credentials
git clone https://github.com/Binary-Insights/Assignment_03.git
cd Assignment_03Create a .env file in the project root. Example:
OPENAI_API_KEY=your-openai-key
PINECONE_API_KEY=your-pinecone-key
PINECONE_INDEX_NAME=your-pinecone-index
DB_HOST=localhost
DB_PORT=5432
DB_NAME=concept_db
DB_USER=postgres
DB_PASSWORD=your-db-password
LANGSMITH_API_KEY=your-langsmith-keyuv sync
# Or, for Docling features:
pip install -r requirements-docling.txtEnsure PostgreSQL is running and the database exists. The backend will auto-create tables on first run.
From the project root:
python run_fastapi.py- Server runs at
http://localhost:8000 - API docs:
http://localhost:8000/docs
- Open
http://localhost:8000/docsin your browser - Try endpoints like
/health,/query,/check-relevance,/concepts
streamlit run src/frontend/rag_streamlit_frontend.py- Set the API URL in the sidebar if needed.
docker compose build –no cache
docker compose up -d- Check
.envfor missing/incorrect keys - Ensure PostgreSQL and Pinecone are accessible
- Review logs for errors
-
Launch an EC2 Instance
- Choose an instance type with ≥8GB RAM (e.g., t3.large).
- Use Ubuntu or Amazon Linux for compatibility.
- Attach your SSH key pair for secure access.
-
Connect to EC2
ssh -i /path/to/your-key.pem ubuntu@<EC2_PUBLIC_IP>
-
Install System Dependencies
sudo apt update sudo apt install python3-pip git docker.io docker-compose -y
-
Clone the Repository
git clone https://github.com/Binary-Insights/Assignment_03.git cd Assignment_03 -
Set Up Environment Variables
- Create your
.envfile as described above.
- Create your
-
Install Python Packages
pip3 install -r requirements.txt
-
(Optional) Start with Docker
sudo docker compose up -d
-
Run FastAPI Server
python3 run_fastapi.py
-
Open Ports
- Ensure security group allows inbound traffic on ports 8000 (FastAPI), 8501 (Streamlit), 8080 (Airflow), etc.
-
Access Services
- FastAPI:
http://<EC2_PUBLIC_IP>:8000 - Streamlit:
http://<EC2_PUBLIC_IP>:8501 - Airflow:
http://<EC2_PUBLIC_IP>:8080
- FastAPI:
data/
├── raw/
│ └── fintbx.pdf
├── parsed/
│ ├── part_001.json
│ ├── part_002.json
│ └── ...
├── embeddings/
│ └── pinecone_vectors/
├── dags/
│ ├── fintbx_ingest_dag.py
│ └── concept_seed_dag.py
├── services/
│ ├── fastapi_app/
│ └── streamlit_ui/
└── logs/
└── airflow/
| Issue | Resolution |
|---|---|
| AWS credentials not found | Verify .env and restart Docker containers. |
| OpenAI API error | Check key and usage limits in .env. |
| Pinecone connection failed | Confirm index name and region exist. |
| Docling parse error | Ensure Python dependencies match Docling 2.57 requirements. |
| “Dag references non-existent pools” | Create pool in Airflow UI → Admin → Pools or remove the pool reference. |
Access interactive documentation and tutorials for Project AURELIA:
Automating Financial Concept Extraction Pipeline
Video Demo
WE ATTEST THAT WE HAVEN’T USED ANY OTHER STUDENTS’ WORK IN OUR ASSIGNMENT AND ABIDE BY THE POLICIES LISTED IN THE STUDENT HANDBOOK.
