A simple chatbot with two selectable chain fields (Solana and EVM). You pick a field and chat; answers are grounded in that field's knowledge base via RAG.
The app shows a clean UI:
- 🔽 Chain field – Dropdown to select Solana or EVM
- 💬 Chat – Type your question (e.g. "Hello, what is solana"); the bot replies using that chain's docs
- Python 3.10+ (including 3.14). The app uses FAISS for the vector store (no ChromaDB).
-
Clone or open the project and go to the project root.
-
Create a virtual environment (recommended):
python -m venv .venv .venv\Scripts\activate # Windows # source .venv/bin/activate # macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment:
- Copy
.env.exampleto.env - Chat (LLM): set
OPENAI_API_KEY(required for replies). - Ingest (embeddings): default is free Hugging Face API. Set
HF_TOKEN(get one at huggingface.co/settings/tokens). If you hit OpenAI quota (429), useEMBEDDING_PROVIDER=huggingfaceandHF_TOKEN=hf_...so ingest runs without OpenAI.
Example
.env:OPENAI_API_KEY=sk-... LLM_MODEL=gpt-4o-mini EMBEDDING_PROVIDER=huggingface HF_TOKEN=hf_... - Copy
- Put Solana-related docs (
.md,.txt,.pdf) indata/solana/ - Put EVM-related docs in
data/evm/ - See data/README.md for sources (e.g. Solana Cookbook, Ethereum docs)
Then run:
python -m app.rag.ingestThis builds FAISS indexes under vector_store/solana and vector_store/evm. If you skip this, the app will error on first chat until you run ingest.
-
Start the backend (from project root):
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Start the frontend (in another terminal):
streamlit run frontend/streamlit_app.py
-
Open the URL shown by Streamlit (e.g. http://localhost:8501). Choose Solana or EVM, then type your message.
If the API runs on another host/port, set:
set CHATBOT_BACKEND_URL=http://localhost:8000
streamlit run frontend/streamlit_app.pyapp/– FastAPI app, config, RAG (ingest + chains), Pydantic modelsapp/rag/ingest.py– Ingest script:python -m app.rag.ingestapp/rag/chains.py– RAG retrieval andget_answer(field, message)frontend/streamlit_app.py– Streamlit UIdata/solana/,data/evm/– Documents to ingest per fieldvector_store/– FAISS index per field (created at runtime; in.gitignore)
