NeuralFoundry is a YAML-driven RAG pipeline that ingests knowledge bases and chat attachments into Postgres + pgvector, then runs one or more queries and prints answers in the terminal (and optionally to an output file). This repo is intentionally simple and CLI-first.
configs/YAML run filesdocuments/sample inputs (optional)outputs/generated answers (one file per run)logs/run logs (one file per run)
- Python 3.11+ for local runs
- Docker Desktop (for Postgres + pgAdmin)
- OpenAI API key
Edit /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry-yaml/.env:
POSTGRES_USER=neuralfoundry_yaml
POSTGRES_PASSWORD=neuralfoundry_yaml_pw
POSTGRES_DB=neuralfoundry_yaml_db
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
# OPENAI_API_KEY=sk-your-keySet your OpenAI key in your shell (recommended):
export OPENAI_API_KEY="your_key_here"python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThis uses Docker only for the database.
# start db
docker compose up -d db
# run the yaml
python run.py configs/run.yamlThis runs the YAML runner inside Docker.
docker compose up --buildThese are the default credentials used by both local and docker runs:
- Host:
localhost(from your Mac) - Port:
5432 - Database:
neuralfoundry_yaml_db - Username:
neuralfoundry_yaml - Password:
neuralfoundry_yaml_pw
If you want to inspect the database in pgAdmin, use these settings:
- Host:
db - Port:
5432 - Database:
neuralfoundry_yaml_db - Username:
neuralfoundry_yaml - Password:
neuralfoundry_yaml_pw
Example YAML files are in configs/:
configs/run.yaml(basic)configs/one_kb.yamlconfigs/multiple_kbs.yamlconfigs/with_attachments.yamlconfigs/attachments_only.yaml
Minimal example:
user:
username: "demo_user"
chat:
title: "YAML Run"
system_prompt: "You are a helpful assistant. Use the provided context when available."
knowledge_bases:
- title: "Sample KB"
description: "Sample documents for a basic run"
replace_if_changed: true
files:
- path: "documents/dataset.txt"
attachments: []
messages:
- "What does the document say about PAN cards and their purpose?"
output_file: true- Logs:
logs/<yaml_name>.log - Outputs:
outputs/<yaml_name>.out.txt
- Knowledge base documents are cached globally by content hash, so reusing the same file across KBs does not re-chunk.
- If you edit a file and want it reprocessed, set
replace_if_changed: truein that KB entry.