Skip to content

Latest commit

 

History

History
117 lines (91 loc) · 3.44 KB

File metadata and controls

117 lines (91 loc) · 3.44 KB

API reference

The public API is intentionally small — most users only need the top-level package and Settings. Everything else lives under named sub-packages so you can pull in deeper components when you need them.

Top-level

from arcs import ARCs, Config, LLMClient, Message, RunResult, Settings, SocketMessage, __version__
Name What it is
ARCs High-level orchestrator. Build from env with ARCs.from_settings().
Settings Runtime configuration model. Load with Settings.load().
Config The per-run configuration the API consumes.
Message A single event payload sent from a workflow.
SocketMessage The websocket envelope wrapping each Message.
RunResult Typed return value from ARCs.run / process.
LLMClient Protocol every workflow LLM satisfies (invoke(prompt) -> str).

ARCs and arcs.llm.build_llm are imported lazily, so import arcs itself does not require LangChain. The lazy attribute loader fires the first time you reference arcs.ARCs.

Workflows

from arcs.workflows import (
    QuestionBreakdown,
    CodeGeneration,
    CodeTesting,
    AutomatedThreading,
)

Each workflow is a standalone unit. Construct it with an LLM, a connector, the number of refinement iterations, and any optional overrides. Call await workflow.start(...) to run a single pass.

LLM clients

from arcs.llm import SimpleChatOpenAI, LocalLLM, LocalFunctionCaller, build_llm

build_llm(settings) is the entry point used by ARCs.from_settings(). Use it directly when you want to share a single LLM between the orchestrator and your own custom code.

Data layer

from arcs.data import (
    BaseConnector,
    ChromaConnector,
    DataDistributor,
    CodeMetadataGenerator,
)

BaseConnector is the contract every backend implements. The DataDistributor walks an uploaded codebase and produces the metadata.jsonl that the connector consumes.

Execution

from arcs.execution import (
    create_venv,
    install_into_venv,
    extract_python_code,
    ensure_dependencies,
    run_py_no_tool,
)

Use these helpers if you want to run generated code without going through the orchestrator (for example, in a custom CI lane).

Messaging

from arcs.messaging import EventStream, ConnectionManager, message_stream

EventStream is the in-process pub/sub used to fan workflow events out to subscribers (websockets, the CLI, your own code). ConnectionManager is a small wrapper around a single FastAPI websocket.

Framework + Chain-of-Thought (research)

from arcs.framework import AgenticSystem, Node, FunctionNode, Edge
from arcs.cot import generate, generate_half
from arcs.research.multilang_tools import run_c, run_py, run_java, run_fortran, run_js
from arcs.research.cpp_analyzer import (
    parse_gprof_output, parse_valgrind_output, parse_perf_stat_output,
)

The research namespace is separated so its heavy / dual-use dependencies don't slip into the default install. Install the onprem and analysis extras if you plan to use them.

CLI

arcs is installed as a console script. arcs --help lists the subcommands; the most common are:

arcs serve                                      # FastAPI + websocket
arcs run "your query" --collection name         # one-shot run
arcs ingest /path/to/code --collection name     # build metadata
arcs version