edgeimpulse/edgeimpulse-api-docs-rag
Edge Impulse API Docs — RAG Assistant
A focused retrieval-augmented assistant for the Edge Impulse API reference (Studio API, ingestion API, remote-management API). Same runtime as the full `edgeimpulse/edgeimpulse-docs-rag` assistant, but the knowledge base is restricted to the API documentation so retrieval stays tightly on-topic for integration and automation questions.
- Scope: Edge Impulse API reference only (
apis,apis_studio,apis_ingestion,apis_remote-management). - Retrieval: FAISS (inner-product) over
data/index, embedded withsentence-transformers/all-MiniLM-L6-v2(384-dim). - Generation: `edgeimpulse/edgeimpulse-docs-qwen-0.5b` via any OpenAI-compatible endpoint (llama.cpp or Ollama).
This repo ships only the prebuilt (API-scoped) index and the inference code — no raw corpus and no index-building pipeline.
Contents
Quickstart
pip install -r requirements.txt
hf download edgeimpulse/edgeimpulse-api-docs-rag --local-dir edgeimpulse-api-docs-rag
cd edgeimpulse-api-docs-rag
# start the generator (llama.cpp)
hf download edgeimpulse/edgeimpulse-docs-qwen-0.5b qwen-edgeai-q4_k_m.gguf --local-dir .
llama-server -m qwen-edgeai-q4_k_m.gguf -c 4096 --port 8080 --jinja
# ask an API question
python rag.py "How do I create an Edge Impulse API key?"
python rag.py "How do I upload data with the ingestion API?" --no-generateServe over HTTP:
python serve.py --host 0.0.0.0 --port 8000
curl -s localhost:8000/ask -H 'content-type: application/json' \
-d '{"question": "How do I classify an image via the API?"}'Configuration
rag.py honours RAG_INDEX_DIR, RAG_API_BASE, and RAG_MODEL (see the full assistant's card for details). For Ollama:
export RAG_API_BASE=http://127.0.0.1:11434/v1
export RAG_MODEL=hf.co/edgeimpulse/edgeimpulse-docs-qwen-0.5bNotes
Because the corpus is intentionally narrow, questions outside the API reference may return "not in context" — that is by design. For general docs questions (devices, deployment targets, ML concepts) use the full `edgeimpulse/edgeimpulse-docs-rag` assistant instead.
License
Apache-2.0. Documentation content belongs to Edge Impulse.
