Skip to content

Latest commit

 

History

History
97 lines (72 loc) · 2.26 KB

File metadata and controls

97 lines (72 loc) · 2.26 KB

Getting started

1. Install

The package core is tiny by design. Pull in only the extras you need.

git clone https://github.com/lanl/arcs.git
cd arcs
python -m venv .venv && source .venv/bin/activate

# Typical: server + LangChain + Chroma + ingestion.
pip install -e ".[langchain,chroma,ingest,server]"

# Or, the kitchen sink:
pip install -e ".[all]"

# Or, the bare-bones core (just typed contracts + event stream + framework):
pip install -e .

The web frontend is independent:

cd apps/web
npm install
npm run dev

2. Configure

Copy .env.example to .env and fill in (at minimum) one of:

# OpenAI / OpenAI-compatible
OPENAI_API_KEY=sk-...
ARCS_OPENAI_MODEL=gpt-4o-mini

# OR a local / on-prem gateway
ARCS_LLM_PROVIDER=local
ARCS_LOCAL_BASE_URL=https://your-litellm.example.com/v1
ARCS_LOCAL_API_KEY=...
ARCS_LOCAL_MODEL=sambanova/Meta-Llama-3.3-70B-Instruct

Settings.load() picks these up automatically.

3. Index a codebase

arcs ingest ./path/to/codebase --collection my_repo --requirements

This walks the directory, asks the LLM to describe each function, file, and folder, and writes a metadata.jsonl next to the source. The metadata is loaded into the configured vector store under the collection name.

4. Run a query

arcs run "Implement an LRU cache" --collection my_repo --system medium

The CLI streams events to stdout. To use the React frontend instead, launch the server:

arcs serve                    # http://localhost:8000
cd apps/web && npm run dev    # http://localhost:5173

5. Embed in your own program

import asyncio
from arcs import ARCs, Settings

async def main():
    arcs = ARCs.from_settings(Settings.load())
    result = await arcs.run(
        query="Write a Fibonacci function",
        collection="my_repo",
        system="medium",
    )
    print(result.final_output)
    print("iterations:", result.iterations)
    print("saved_to:", result.saved_to)

asyncio.run(main())

result is a typed RunResult: final_output, history, artifacts, events, iterations, saved_to. You no longer need to drain the event stream to learn what happened — though the events are still there if you want them (result.events).