Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Contributing to Locus
# Contributing

Locus — *Oracle Generative AI · Multi-Agent Reasoning Orchestrator SDK* —
The Oracle Generative AI – Multi-Agent Locus SDK — formally
*Oracle Generative AI Multi-Agent Reasoning Orchestrator SDK* —
is built inside Oracle, used in production, and open to everyone.
This document covers how to set up a development environment, the
review and sign-off process, the coding standards we hold the codebase
Expand Down Expand Up @@ -534,4 +535,4 @@ and how `LocusDeprecationWarning` works.
- Open a [GitHub Discussion](https://github.com/oracle-samples/locus/discussions)
- Check existing [Issues](https://github.com/oracle-samples/locus/issues)

Thank you for contributing to Locus!
Thank you for contributing to the SDK!
5 changes: 3 additions & 2 deletions DEPRECATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Deprecation policy

Locus is pre-1.0. This file explains how breaking changes and
deprecations work today, and how they will work after 1.0.
The Oracle Generative AI – Multi-Agent Locus SDK is pre-1.0. This
file explains how breaking changes and deprecations work today, and
how they will work after 1.0.

## Current state (0.x)

Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://raw.githubusercontent.com/oracle-samples/locus/main/docs/img/og-card.png?v=2" alt="locus — Multi-Agent SDK · pip install locus-sdk · Built by Oracle · github.com/oracle-samples/locus" width="720">
<img src="https://raw.githubusercontent.com/oracle-samples/locus/main/docs/img/og-card.png?v=2" alt="Oracle Generative AI – Multi-Agent Locus SDK · pip install locus-sdk · Built by Oracle · github.com/oracle-samples/locus" width="720">
</p>

<p align="center">
Expand Down Expand Up @@ -31,7 +31,7 @@
</p>

<p align="center">
<strong>Try every locus pattern in your browser →</strong>
<strong>Try every Oracle Generative AI – Multi-Agent Locus SDK pattern in your browser →</strong>
<a href="https://locusagents.oracle.com/workbench/"><strong>Workbench guide</strong></a><br>
<em>Step-by-step setup for the browser playground — run it on localhost in three terminals, or in a single Docker container. Wire up an OCI profile, or bring your own OpenAI / Anthropic key.</em>
</p>
Expand Down Expand Up @@ -97,7 +97,7 @@ No mandatory cloud account to start — `MockModel` lets every notebook run offl
## Talk to any provider

A model is a string. The prefix before the colon (`oci:`, `openai:`,
`anthropic:`, `ollama:`) tells locus which provider to use; the rest is
`anthropic:`, `ollama:`) tells the SDK which provider to use; the rest is
the model id that provider expects. `get_model()` parses the string and
returns a ready client.

Expand Down Expand Up @@ -198,7 +198,7 @@ approval-gated agent — chosen by protocol selection, not by the model.

## Eight orchestration shapes

When one agent isn't enough, locus gives you seven in-process shapes plus cross-process A2A.
When one agent isn't enough, the SDK gives you seven in-process shapes plus cross-process A2A.
Every pattern uses the same `Agent` class and the same event stream.

| Pattern | When to use |
Expand Down Expand Up @@ -243,24 +243,24 @@ print(result.text)
| **[🔎 RAG](https://locusagents.oracle.com/concepts/rag/)** | 4 vector stores — Oracle 26ai · OpenSearch · pgvector · in-memory. OCI Cohere + OpenAI embeddings · multimodal (PDF, image OCR, audio). |
| **[📡 Streaming + Server](https://locusagents.oracle.com/concepts/server/)** | Typed events · SSE · `AgentServer` (FastAPI, per-principal thread isolation). |
| **[🪝 Hooks](https://locusagents.oracle.com/concepts/hooks/)** | Logging · OpenTelemetry · ModelRetry · Guardrails · Steering (LLM-as-judge). |
| **[🪙 MCP](https://locusagents.oracle.com/concepts/mcp/)** | `MCPClient` consumes MCP servers. `LocusMCPServer` exposes locus tools as MCP. |
| **[🪙 MCP](https://locusagents.oracle.com/concepts/mcp/)** | `MCPClient` consumes MCP servers. `LocusMCPServer` exposes the SDK's tools as MCP. |
| **[🌐 Multi-modal](https://locusagents.oracle.com/concepts/multi-modal-providers/)** | `Agent(web_search=…, web_fetch=…, image_generator=…, speech_provider=…)` auto-registers tools. |
| **[📊 Evaluation](https://locusagents.oracle.com/concepts/evaluation/)** | `EvalCase` / `EvalRunner` / `EvalReport` regression suites. |
| **[🧰 Models](https://locusagents.oracle.com/concepts/models/)** | OCI GenAI (90+ models, V1 + SDK) · OpenAI · Anthropic · Ollama. |

---

## Inside locus — the stack, not just the loop
## Inside the SDK — the stack, not just the loop

A locus agent isn't a one-shot ReAct loop. The same `Agent` class runs
inside eight orchestration shapes, chosen automatically by the **PRISM
cognitive router** from a natural-language task, with typed reasoning
around every Execute and **Oracle Database 26ai** as a first-class
durable backend. The agent loop is the inner engine — locus is the
whole stack around it.
An Oracle Generative AI – Multi-Agent Locus SDK agent isn't a one-shot
ReAct loop. The same `Agent` class runs inside eight orchestration
shapes, chosen automatically by the **PRISM cognitive router** from a
natural-language task, with typed reasoning around every Execute and
**Oracle Database 26ai** as a first-class durable backend. The agent
loop is the inner engine — the SDK is the whole stack around it.

<p align="center">
<img src="docs/img/locus-stack.svg" alt="The locus stack — PRISM cognitive router compiles natural-language tasks into one of 8 orchestration shapes (SequentialPipeline, ParallelPipeline, LoopAgent, StateGraph, Orchestrator + Specialists, Swarm, Handoff Chain, A2A Mesh), each of which runs the agent loop (Think → Execute → Reflect → Terminate), powered by foundations (Models, Memory, RAG, Observability, Tools/MCP/Skills) and anchored on Oracle Database 26ai" width="100%">
<img src="docs/img/locus-stack.svg" alt="The SDK stack — PRISM cognitive router compiles natural-language tasks into one of 8 orchestration shapes (SequentialPipeline, ParallelPipeline, LoopAgent, StateGraph, Orchestrator + Specialists, Swarm, Handoff Chain, A2A Mesh), each of which runs the agent loop (Think → Execute → Reflect → Terminate), powered by foundations (Models, Memory, RAG, Observability, Tools/MCP/Skills) and anchored on Oracle Database 26ai" width="100%">
</p>

- **PRISM Cognitive Router** — an LLM classifier reads the task and fills a typed `GoalFrame` (intent · domain · complexity · risk); the `CognitiveCompiler` emits the matching runtime shape. The model classifies, never authors graph topology.
Expand All @@ -275,7 +275,7 @@ Every node at every layer emits a write-protected typed event — the same strea

## Backed by Oracle Database 26ai

locus ships native primitives for **Oracle Database 26ai** — vector
The SDK ships native primitives for **Oracle Database 26ai** — vector
search, durable agent threads, in-database chunking and embeddings, and
a long-term key/value store. The contract is owned end-to-end inside
`locus.rag.stores` and `locus.memory.backends`, and the same connection
Expand Down Expand Up @@ -310,7 +310,7 @@ The seven primitives:
| **`OracleInDBChunker`** | Server-side text chunking via `DBMS_VECTOR_CHAIN.UTL_TO_CHUNKS`. Text never leaves the database. |
| **`OracleInDBEmbeddings`** | In-database ONNX embeddings via `DBMS_VECTOR_CHAIN.UTL_TO_EMBEDDING`. Zero round-trips when the embedding model is loaded in the DB. |

The contracts live in locus, the SQL is generated locally, and the
The contracts live in the SDK, the SQL is generated locally, and the
only runtime requirement is `python-oracledb` thin mode.

→ [Notebook 06 — Oracle 26ai RAG](https://locusagents.oracle.com/notebooks/notebook_41_oracle_26ai_rag/) · [Notebook 07 — Oracle 26ai checkpointer](https://locusagents.oracle.com/notebooks/notebook_53_oracle_26ai_checkpointer/) · [Notebooks 08-12 — loader, chunker, embeddings, store, versioned saver](https://locusagents.oracle.com/notebooks/)
Expand Down Expand Up @@ -363,7 +363,7 @@ python examples/notebook_69_research_workflow.py # full research pipeline

## Workbench

A browser-based playground for every locus pattern. Two clicks to a
A browser-based playground for every SDK pattern. Two clicks to a
running agent — no CLI install, no editor setup. Three model slots
(A / B / C) so multi-agent notebooks can mix a fast triage model
with a deeper specialist. The **Notebooks** sidebar lists all 68
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Reporting a Vulnerability

If you believe you have found a security vulnerability in Locus, please report it to us through coordinated disclosure.
If you believe you have found a security vulnerability in the Oracle Generative AI – Multi-Agent Locus SDK, please report it to us through coordinated disclosure.

**Please do not report security vulnerabilities through public GitHub issues.**

Expand All @@ -23,7 +23,7 @@ We will acknowledge receipt of your vulnerability report and send you regular up

## Security Best Practices

When using Locus in production:
When using the SDK in production:

1. **API Keys**: Never commit API keys or secrets to version control. Use environment variables or secret management systems.

Expand Down
7 changes: 4 additions & 3 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Capabilities

Everything `locus` ships, what it does, and where to find it.
Everything Oracle Generative AI – Multi-Agent Locus SDK ships, what it
does, and where to find it.

!!! oracle-distinctive "Distinctive to locus"
!!! oracle-distinctive "Distinctive to the SDK"
These ship as core primitives, inside the ReAct loop — not as
middleware, plugins, or third-party libraries:

Expand Down Expand Up @@ -53,7 +54,7 @@ Everything `locus` ships, what it does, and where to find it.
| **`GoalFrame`** | Typed schema the LLM extractor fills — 13 `TaskType`s, `Risk`, `Complexity`, domain, capabilities | `locus.router.GoalFrame` |
| **`ProtocolRegistry`** | Typed filter (`handles ∋ goal`, `risk_max ≥ frame.risk`) + four-tier ranking (distance · canonical · cost · specificity) | `locus.router.ProtocolRegistry` |
| **`PolicyGate`** | Two thresholds: `max_risk` (hard deny) and `require_approval_above` (human-in-the-loop gate) | `locus.router.PolicyGate` |
| **`CognitiveCompiler`** | Instantiates real locus primitives from frame + protocol; emits a `Runnable` adapter | `locus.router.CognitiveCompiler` |
| **`CognitiveCompiler`** | Instantiates real SDK primitives from frame + protocol; emits a `Runnable` adapter | `locus.router.CognitiveCompiler` |
| **`builtin_protocols()`** | 8 v1 protocols: `direct_response` · `plan_execute_validate` · `specialist_fanout` · `debate` · `codegen_test_validate` · `approval_gated_execution` · `a2a_delegate` · `handoff_chain` | `locus.router.builtin_protocols` |
| **`CapabilityIndex`** | Domain + risk overlay on `ToolRegistry` — no parallel storage | `locus.router.CapabilityIndex` |
| **`SkillIndex`** | Domain-tagged view of installed `Skill` packs; scoped catalog attached to every emitted Agent | `locus.router.SkillIndex` |
Expand Down
11 changes: 6 additions & 5 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Capabilities

Everything `locus` ships, what it does, and where to find it.
Everything Oracle Generative AI – Multi-Agent Locus SDK ships, what it
does, and where to find it.

!!! oracle-distinctive "Distinctive to locus"
!!! oracle-distinctive "Distinctive to the SDK"
These are architectural choices no other Python agent framework ships
together in one coherent stack:

- **Multi-agent reasoning orchestrator** — describe a task; a
typed registry picks one of eight protocols and instantiates the
matching locus primitive. The LLM fills a typed `GoalFrame`; routing is
matching SDK primitive. The LLM fills a typed `GoalFrame`; routing is
rule-based. Eight protocols: `direct_response` (single Agent),
`plan_execute_validate` (SequentialPipeline), `specialist_fanout`
(ParallelPipeline), `debate` (two debaters + judge),
Expand Down Expand Up @@ -73,7 +74,7 @@ Most agent frameworks force a choice: hand-code the topology (predictable
but brittle) or let the LLM pick it (flexible but unpredictable). The
cognitive router takes a third path — **bounded graph generation**. The LLM fills exactly
one typed `GoalFrame`; a typed registry selects from eight
named protocols; a compiler instantiates real locus primitives. The
named protocols; a compiler instantiates real SDK primitives. The
output is always one of the eight proven shapes — never an ad-hoc topology
the model invented.

Expand All @@ -83,7 +84,7 @@ the model invented.
| **`GoalFrame`** | Typed schema the LLM extractor fills — 13 `TaskType`s, `Risk`, `Complexity`, domain, capabilities | `locus.router.GoalFrame` |
| **`ProtocolRegistry`** | Typed filter (`handles ∋ goal`, `risk_max ≥ frame.risk`) + four-tier ranking (distance · canonical · cost · specificity) | `locus.router.ProtocolRegistry` |
| **`PolicyGate`** | Two thresholds: `max_risk` (hard deny) and `require_approval_above` (human-in-the-loop gate) | `locus.router.PolicyGate` |
| **`CognitiveCompiler`** | Instantiates real locus primitives from frame + protocol; emits a `Runnable` adapter | `locus.router.CognitiveCompiler` |
| **`CognitiveCompiler`** | Instantiates real SDK primitives from frame + protocol; emits a `Runnable` adapter | `locus.router.CognitiveCompiler` |
| **`builtin_protocols()`** | 8 v1 protocols: `direct_response` · `plan_execute_validate` · `specialist_fanout` · `debate` · `codegen_test_validate` · `approval_gated_execution` · `a2a_delegate` · `handoff_chain` | `locus.router.builtin_protocols` |
| **`CapabilityIndex`** | Domain + risk overlay on `ToolRegistry` — no parallel storage | `locus.router.CapabilityIndex` |
| **`SkillIndex`** | Domain-tagged view of installed `Skill` packs; scoped catalog attached to every emitted Agent | `locus.router.SkillIndex` |
Expand Down
17 changes: 9 additions & 8 deletions docs/concepts/agent-loop.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# The locus agent loop
# The agent loop

Every locus agent runs the same loop. Four named nodes
(`Think → Execute → Reflect → Terminate`), one router that decides what
runs next, one typed event stream, one piece of immutable state that
flows through. This page is the architectural reference — what each
node does, why it exists, what it emits, and how to extend it.
Every Oracle Generative AI – Multi-Agent Locus SDK agent runs the same
loop. Four named nodes (`Think → Execute → Reflect → Terminate`), one
router that decides what runs next, one typed event stream, one piece of
immutable state that flows through. This page is the architectural
reference — what each node does, why it exists, what it emits, and how
to extend it.

![locus agent loop — Think → Execute → Reflect → Terminate, with idempotent dedupe at Execute, Reflexion and Causal at Reflect, and composable termination algebra at Terminate](../img/agent-loop.svg)
![Agent loop — Think → Execute → Reflect → Terminate, with idempotent dedupe at Execute, Reflexion and Causal at Reflect, and composable termination algebra at Terminate](../img/agent-loop.svg)

The loop is implemented in
[`src/locus/loop/`](https://github.com/oracle-samples/locus/tree/main/src/locus/loop)
Expand All @@ -23,7 +24,7 @@ The base pattern is **ReAct** ([Yao et al., 2022](https://arxiv.org/abs/2210.036
*Thought → Action → Observation*, repeated until the model decides
to stop. ReAct is now the default loop in most agentic SDKs.

locus keeps the spirit and adds three things:
The SDK keeps the spirit and adds three things:

- **Action becomes Execute** — a real node in the graph that owns
tool dispatch *and* idempotency dedup, not a callback.
Expand Down
5 changes: 3 additions & 2 deletions docs/concepts/agent.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Agent

`Agent` is the unit you build everything else from. Hand it a model, a
`Agent` is the unit you build everything else from in
Oracle Generative AI – Multi-Agent Locus SDK. Hand it a model, a
list of tools, a system prompt, and any optional features (reflexion,
grounding, checkpointing) — locus drives the
grounding, checkpointing) — the SDK drives the
[Think → Execute → Reflect → Terminate](agent-loop.md) loop, streams
typed events as it runs, and returns a typed `AgentResult` when it
stops.
Expand Down
13 changes: 7 additions & 6 deletions docs/concepts/checkpointers.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ Fastest reads, optional TTL for ephemeral conversations.

### Oracle 26ai: `oracle_checkpointer` + `OracleCheckpointSaver`

If your stack is already on **[Oracle Autonomous Database 26ai][adb]**, locus
ships two native checkpointers — one to colocate agent state with the
rest of your app data, the other to give LangGraph-style versioned
history in the same database.
If your stack is already on **[Oracle Autonomous Database 26ai][adb]**,
Oracle Generative AI – Multi-Agent Locus SDK ships two native
checkpointers — one to colocate agent state with the rest of your app
data, the other to give LangGraph-style versioned history in the same
database.

#### Single-row per thread — `oracle_checkpointer`

Expand Down Expand Up @@ -187,7 +188,7 @@ checkpointer](../notebooks/notebook_53_oracle_26ai_checkpointer.md).

## Two checkpointer shapes — the gotcha to know

locus has **two** kinds of checkpointer implementations and you need
The SDK has **two** kinds of checkpointer implementations and you need
to wire them differently:

1. **Native checkpointers** implement `BaseCheckpointer` directly and
Expand Down Expand Up @@ -282,7 +283,7 @@ directly for anything cross-thread that doesn't need LLM extraction

### Production: `OracleStore` on Oracle 26ai

Locus ships a native `BaseStore` implementation backed by Oracle 26ai —
The SDK ships a native `BaseStore` implementation backed by Oracle 26ai —
the equivalent of `langgraph-oracledb.OracleStore`, with **zero**
langchain/langgraph dependency. Namespaces persist as primary keys on
a single table; optional vector search runs natively against an
Expand Down
12 changes: 6 additions & 6 deletions docs/concepts/conversation-management.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Conversation management

A locus agent holds one user's conversation in `state.messages`. To
make that conversation **survive across requests** — across deploys,
restarts, and "I'll come back tomorrow" gaps — you wire a
checkpointer and a `thread_id`.
An Oracle Generative AI – Multi-Agent Locus SDK agent holds one user's
conversation in `state.messages`. To make that conversation **survive
across requests** — across deploys, restarts, and "I'll come back
tomorrow" gaps — you wire a checkpointer and a `thread_id`.

## The minimum

Expand Down Expand Up @@ -34,7 +34,7 @@ thread_id=...)` call rehydrates state before the first Think.

## Threads, not sessions

locus uses **thread** as the term — borrowing from chat UIs and
The SDK uses **thread** as the term — borrowing from chat UIs and
issue trackers — because a single user can have many simultaneous
conversations:

Expand Down Expand Up @@ -98,7 +98,7 @@ bug — you'll race on the checkpoint. Three patterns to avoid that:
serialise messages per session.
2. **Distinct sub-threads.** If the user asks two things in
parallel, give them two thread ids.
3. **Last-write-wins is the default.** locus checkpointers do not
3. **Last-write-wins is the default.** The SDK's checkpointers do not
currently expose a conflict exception — if you need optimistic
concurrency, layer it at the application or database level.

Expand Down
5 changes: 3 additions & 2 deletions docs/concepts/deepagent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DeepAgent

Locus ships two primitives for long-horizon research:
Oracle Generative AI – Multi-Agent Locus SDK ships two primitives for
long-horizon research:

| | `create_deepagent` | `create_research_workflow` |
|---|---|---|
Expand Down Expand Up @@ -222,7 +223,7 @@ agent = create_deepagent(
)
```

Activates locus's `SummarizingManager` so older turns are condensed
Activates the SDK's `SummarizingManager` so older turns are condensed
once the conversation exceeds the threshold. Prevents context blowout
on long research runs without losing recent reasoning steps.

Expand Down
Loading