| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
NeuralFoundry is a hands-on, modular RAG playground that shows how real AI systems are built. The code is intentionally organized so you can study or swap components without rewriting the whole stack.
Chat Memory
We store each message (user + assistant) as text + vector embeddings. Retrieval pulls recent messages and semantically similar older messages to keep context.
Knowledge Bases (KBs)
Each KB has documents stored with metadata. We embed chunks and retrieve the most relevant ones at query time.
Chat Attachments
You can attach files directly to a chat. Those files are processed into chunks and stored as embeddings, then used as extra context just for that chat.
Chunking Strategy
Retrieval & Similarity Thresholds
Vector similarity search uses pgvector.
Similarity thresholds (e.g., KB chunk threshold) are configurable in settings, so you can tune relevance vs. recall without changing code.
This is the recommended way to run everything together: Postgres + pgvector, backend, frontend, and pgAdmin.
Create or edit /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/.env:
POSTGRES_USER=neuralfoundry
POSTGRES_PASSWORD=neuralfoundry_pw
POSTGRES_DB=neuralfoundry
POSTGRES_HOST=localhost
POSTGRES_PORT=5432Set your OpenAI key in the macOS environment (not in .env):
export OPENAI_API_KEY="your_key_here"docker compose -p neuralfoundry-ui -f /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/docker-compose.yml up --buildThis removes all Postgres data and starts clean.
docker compose -p neuralfoundry-ui -f /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/docker-compose.yml down -v
docker compose -p neuralfoundry-ui -f /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/docker-compose.yml up --buildThe backend prints a compact retrieval summary so you can quickly understand what context the model is using:
============================================================ 🐛 RETRIEVAL RESULTS: - Recent messages: 5 - Older messages: 0 - KB chunks: 0 - Attachment chunks: 0 ⚠️ NO KB RESULTS FOUND! ⚠️ No KBs are attached to this chat! ℹ️ No attachments found in this chat ============================================================
Here’s a minimal view of how data is connected:
User
└── ChatSession
├── ChatMessage (vector embedding)
├── ChatAttachment
│ └── ChatAttachmentChunk (vector embedding)
└── ChatSessionKB (links chat ↔ KB)
KnowledgeBase
└── KBDocument
└── KBChunk (vector embedding)
To avoid collisions with NeuralFoundry-yaml, this UI stack uses separate defaults:
You can override these if needed:
NF_UI_DB_PORT=5433 NF_UI_PGADMIN_PORT=8081 docker compose -p neuralfoundry-ui -f /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/docker-compose.yml up --buildpgAdmin will auto-register a server named neuralfoundry. If prompted for a password, use:
If you want to run backend/frontend locally:
docker run --name nf-postgres \
-e POSTGRES_USER=neuralfoundry \
-e POSTGRES_PASSWORD=neuralfoundry_pw \
-e POSTGRES_DB=neuralfoundry \
-p 5432:5432 \
-d pgvector/pgvector:pg16docker run --name nf-pgadmin \
-e PGADMIN_DEFAULT_EMAIL=thomaskuttyreji.1396@gmail.com \
-e PGADMIN_DEFAULT_PASSWORD=admin_pw \
-p 8080:80 \
-d dpage/pgadmin4cd /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reloadFrontend:
cd /Users/thomaskuttyreji/Documents/GitHub/NeuralFoundry/frontend
npm install
npm run dev| Back | FazBrowse Home | New Git URL |