Economics AI Agent: RAG Over a Vector Database of Economic and Financial Data
An AI agent answers economics questions from a curated knowledge base, not from memory. A scheduled pipeline embeds source data into a vector database, structured figures go into tables, and every answer is grounded in retrieved data.

- ×Reference data spread across spreadsheets and websites
- ×A general chatbot answered from training data
- ×No sources, and numbers often out of date
- ✓A scheduled pipeline embeds fresh content into Pinecone
- ✓Structured indicators stored in tables
- ✓The agent retrieves context and exact figures before answering
- ✓Answers come only from what was retrieved
Stack
How It Works
Scheduled ingestion
The source list is read from Google Sheets and Firecrawl extracts clean content from each source.
Chunk and embed
Content is split into chunks and embedded with the OpenAI API.
Upsert to the vector database
Embeddings are upserted into Pinecone, so the knowledge base stays current without manual re-indexing.
Store structured figures
Indicators and time series go into tables, so numeric questions get exact values instead of approximate text.
Answer with RAG
The agent retrieves the relevant chunks and table rows for each question and answers from them.
Results
answers grounded in retrieved data
automatic re-indexing
text and exact figures
The Workflows
Ingestion and embeddings
- ✓Sources re-read and re-embedded on a schedule
- ✓Content chunked and stored in a vector database for retrieval
- ✓No manual re-indexing when sources change

Answers grounded in retrieved data
- ✓Every answer is built from retrieved passages, not model memory
- ✓Analysis comes with the source it was drawn from


Tables for exact figures
- ✓Numeric questions answered from tables, not approximate text
- ✓The agent can build a table on request and share a link



FAQ
What is RAG?+
Retrieval-augmented generation: the agent searches a knowledge base for relevant passages first and writes its answer from them, instead of relying on what the model remembers.
Which vector database does it use?+
Pinecone, with OpenAI embeddings, orchestrated in n8n.
How does the knowledge base stay current?+
A scheduled pipeline re-reads the sources, re-embeds changed content and upserts it to the index.
Can it give exact numbers?+
Yes. Structured indicators live in tables, so numeric questions are answered from the table rather than from text.


