demo / README.md
IPF's picture
Upload 5 files
4565c8b verified
metadata
title: DCI-Agent Demo
emoji: ๐Ÿ”ฎ
colorFrom: purple
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false

DCI-Agent Search

A Prestige Purple-themed Hugging Face Spaces app for autonomous document search over Wikipedia and other datasets.

Features

  • Autonomous search: Pi reads files and runs shell commands (rg, grep, find, etc.) to answer your questions over a corpus.
  • Real-time terminal: Watch Pi's reasoning and tool execution in a live terminal-like log.
  • Default corpus: Wikipedia corpus with multi-hop QA examples from 2WikiMultiHopQA, HotpotQA, and other datasets.
  • Upload your own corpus: ZIP upload with per-file (1 KB) and total (15 MB) limits.
  • Native PI runner: Uses the original DCI-Agent Pi CLI via RPC. The Docker build now requires pi-mono to build successfully so remote deployments stay aligned with local behavior.

Deployment

Hugging Face Spaces (Docker)

  1. Create a new Space on Hugging Face, choose Docker as the SDK.
  2. Upload the contents of this web-app/ directory.
  3. Set your OPENAI_API_KEY as a Space secret (optional โ€” users can also provide it in the UI).
  4. The Space will build and launch automatically.

Local testing

cd web-app
pip install -r requirements.txt
python app.py

Open http://localhost:7860 in your browser.

Usage

  1. Enter your OpenAI API key.
  2. Choose a model (gpt-4o recommended).
  3. Set max turns (default: 6).
  4. Either check "Use Default Corpus" or upload your own ZIP file.
  5. Type a question and click Run Search.
  6. Watch the terminal log for real-time progress.
  7. The final answer appears in the Final Answer box.

File structure

web-app/
โ”œโ”€โ”€ app.py                  # Gradio UI and orchestration
โ”œโ”€โ”€ pi_wrapper.py           # PI RPC client and native runner integration
โ”œโ”€โ”€ Dockerfile              # HF Spaces Docker image
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ default_corpus/         # Wikipedia corpus (wiki_dump.jsonl)
โ”‚   โ”œโ”€โ”€ biology/
โ”‚   โ”œโ”€โ”€ earth_science/
โ”‚   โ”œโ”€โ”€ economics/
โ”‚   โ””โ”€โ”€ robotics/
โ””โ”€โ”€ README.md

Design

Prestige Purple theme:

  • Deep purples (#B4AFF2, #5822B4) and rich blacks (#0A0A12, #141420).
  • Plus Jakarta Sans for headings and body.
  • JetBrains Mono for the terminal log.
  • Cinematic gradients and generous whitespace.