### Install Frontend Dependencies and Start Development Server Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/frontend/README.md Navigate to the frontend directory, install dependencies (handling peer conflicts), and start the development server. ```bash cd apps/studio/frontend npm install --legacy-peer-deps # pre-existing ESLint peer conflict, will resolve in a future cleanup npm run dev ``` -------------------------------- ### Install and Start Lionagi Studio Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0018-studio-distribution.md Install the Lionagi package with studio support and start the studio server. Users require Python 3.11+ and pip. ```text pip install lionagi[studio] # or: pip install lionagi (if studio becomes default) li studio # starts uvicorn, serves frontend + API on 127.0.0.1:8765 ``` -------------------------------- ### Install Lionagi and Start Lion Studio Source: https://github.com/khive-ai/lionagi/blob/main/README.md Install Lionagi using pip and launch the Lion Studio web UI. Docker is the recommended installation method. ```bash pip install lionagi ``` ```bash li studio # auto-pulls ghcr.io/ohdearquant/lion-studio # UI → http://localhost:3000 API → http://localhost:8765 ``` ```bash git clone https://github.com/ohdearquant/lionagi.git && cd lionagi pip install ".[studio]" li studio --dev # starts backend + frontend with hot reload ``` -------------------------------- ### Install Lionagi Skills Source: https://github.com/khive-ai/lionagi/blob/main/examples/skills/README.md Copy skill directories into the ~/.lionagi/skills/ directory to install them. This example shows installing the 'hello' and 'commit' skills. ```bash cp -r examples/skills/hello ~/.lionagi/skills/ cp -r examples/skills/commit ~/.lionagi/skills/ ``` -------------------------------- ### Install Lionagi Source: https://github.com/khive-ai/lionagi/blob/main/docs/cookbook/research-synthesis.md Install the Lionagi library using pip or uv. This is the initial setup step. ```bash pip install lionagi # or: uv add lionagi ``` -------------------------------- ### Install Backend and Studio Dependencies Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/frontend/README.md Install backend and studio dependencies from the repository root. ```bash uv pip install -e '.[studio]' ``` -------------------------------- ### Agent Configuration and Tool Registry Setup Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0051-tool-registry-allowlists.md Demonstrates setting up an `AgentConfig` with various hooks, including the `verify_in_registry` gate, and then creating an agent. It also shows how to install the registry policy directly on tools managed by the agent's `ActionManager` after creation. ```python # Library-mode setup composes registry policy with existing hooks.py handlers. config = AgentConfig.coding() policy = ToolRegistryPolicy() policy.add( category="tool", value="write_file", scope=RegistryScope.PROJECT, scope_id="my-project", registered_by="ocean", reason="Approved for sandbox write operations.", ) # Before create_agent(): AgentConfig wires hooks through Tool.preprocessor. config.pre("*", make_verify_in_registry_gate(policy, project_id="my-project")) config.pre("bash", guard_destructive) config.pre("editor", guard_paths(allowed_paths=["/workspace/project/"])) config.post("*", log_tool_use) branch = await create_agent(config) policy.bind_logger(branch._log_manager) # For tools registered after create_agent(), install directly on ActionManager. install_registry_policy(branch.acts, policy, project_id="my-project") ``` -------------------------------- ### Install Frontend Dependencies and Start Dev Server Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/README.md Installs npm dependencies for the frontend and starts the Vite development server. The server runs on http://localhost:5173 and proxies /api requests to the backend. ```bash cd apps/studio/frontend npm install npm run dev ``` -------------------------------- ### Install LionAGI and FastAPI Source: https://github.com/khive-ai/lionagi/blob/main/notebooks/using_claude_code/claude_proxy/README.md Install the required libraries using pip. ```bash uv add lionagi fastapi loguru ``` -------------------------------- ### Initialize and start Supabase Source: https://github.com/khive-ai/lionagi/blob/main/notebooks/persist_to_postgres_supabase.ipynb Initialize a new Supabase project and start the Supabase services. This is typically done in the terminal. ```bash supabase init supabase start supabase status ``` -------------------------------- ### Install Lion Studio with pipx Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/desktop/src-tauri/assets/setup.html Use this command to install the Lion Studio backend using pipx. ```bash pipx install 'lionagi[studio]' ``` -------------------------------- ### Install All Dependencies Source: https://github.com/khive-ai/lionagi/blob/main/AGENT.md Use this command to install all project dependencies, including extras. Avoid using pip directly. ```bash uv sync --all-extras ``` -------------------------------- ### Install Lion Studio with uv Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/desktop/src-tauri/assets/setup.html Use this command to install the Lion Studio backend using uv pip. ```bash uv pip install 'lionagi[studio]' ``` -------------------------------- ### Install Lionagi and Codex Source: https://github.com/khive-ai/lionagi/blob/main/docs/cookbook/codebase-audit.md Install the Lionagi library and the Codex CLI. Codex requires a ChatGPT Plus/Pro subscription. ```bash pip install lionagi # or: uv add lionagi # codex — requires ChatGPT Plus/Pro subscription (not an API key): npm install -g @openai/codex codex login ``` -------------------------------- ### Verify Lionagi CLI Installation Source: https://github.com/khive-ai/lionagi/blob/main/docs/getting-started/install.md Verify that the Lionagi CLI is installed correctly by running the help command. ```bash li --help ``` -------------------------------- ### Primitive Invocation Examples Source: https://github.com/khive-ai/lionagi/blob/main/docs/cli-reference.md Examples of how to invoke the three reusable primitives (Agent profile, Skill, Playbook) stored under ~/.lionagi/. ```bash li agent -a ``` ```bash li o flow -a ``` ```bash li skill ``` ```bash li play ``` -------------------------------- ### Start Lion Studio Backend Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/frontend/README.md Start the Lion Studio backend service, disabling frontend mode and specifying the port. ```bash li studio start --frontend-mode none --port 8765 ``` -------------------------------- ### Freshness State Rendering Examples Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0034-frontend-data-and-state-architecture.md Examples of how the UI renders the freshness state of data, indicating whether it's live, disconnected, or stale. ```text Live · verified 8s ago Disconnected · polling every 5s Stale · last verified 48s ago ``` -------------------------------- ### Good Document Structure Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/governance/standards/dsl-style.md Example of a correctly structured v0 charter with all required top-level keys present in the correct order. ```yaml charter_dsl: "0.1" kind: agent_charter metadata: { ... } agents: [ ... ] registry: { ... } constraints: [ ... ] sod: { active: true, rules: [] } permissions: { ... } trace: { ... } ``` -------------------------------- ### Skill Metadata Conventions Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0020-skill-invocations.md Illustrates the metadata shape for different skills, showing example JSON structures for '/show' and '/codex-pr-review'. ```text | Skill | Metadata shape | |-------|---------------| | /show | {topic, goal, plays: [{name, status, attempt}], waves: [...]} | | /codex-pr-review | {pr_number, rounds: [{round, verdict, resume_id}]} | | (future orchestrator skills) | {skill-specific fields} | ``` -------------------------------- ### Install Dependencies and Run Benchmark Source: https://github.com/khive-ai/lionagi/blob/main/benchmarks/comparisons/README.md Clone the repository, install necessary dependencies using uv, and run the full benchmark or a quick test. It's recommended to pin exact versions for reproducibility. ```bash # Clone repository git clone https://github.com/lion-agi/lionagi.git cd lionagi/benchmarks/comparisons # Install dependencies uv add --dev langgraph langchain-core llama-index-core pyautogen psutil # (Recommended) Pin exact versions for reproducibility uv lock # Or export a frozen requirements file: uv export --frozen --format requirements.txt > bench.requirements.txt # Run full benchmark (20 runs, ~15 minutes) uv run python benchmark_professional.py --runs 20 --report # Generate report uv run python generate_benchmark_report.py # Quick test (3 runs) uv run python benchmark_professional.py --runs 3 ``` -------------------------------- ### Session and Branch Initialization Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0039-knowledge-substrate-minimal-interface.md Demonstrates how to initialize a Session with a KnowledgeStore and create a new Branch. Shows how the session's KnowledgeStore is passed to the Branch by default. ```python session = Session( knowledge_store=SQLiteKnowledgeStore("~/.lionagi/knowledge.db"), ) branch = session.new_branch(system="You are a researcher") # branch._knowledge_store == session._knowledge_store ``` -------------------------------- ### Attention Endpoint Request Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0030-attention-queue.md Example of a GET request to the attention endpoint with query parameters for severity, limit, and inclusion of dismissed items. ```text GET /api/attention?severity=critical,warning&limit=50&include_dismissed=false ``` -------------------------------- ### Run Tauri Dev Mode Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/desktop/README.md Start the Tauri development server. This requires the Vite dev server to be running first and cargo-tauri to be installed. Run this in a separate terminal. ```bash # Terminal 2 — Tauri dev (requires cargo-tauri installed) cd apps/studio/desktop/src-tauri && cargo tauri dev ``` -------------------------------- ### Cross-entity Search API Endpoint Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0034-frontend-data-and-state-architecture.md This is an example of a GET request to the search API. It demonstrates how to query for results across various entity types within a specified time range. ```text GET /api/search?q=failed&project=all&range=1h&type=all ``` -------------------------------- ### Invoke Lionagi Skills Source: https://github.com/khive-ai/lionagi/blob/main/examples/skills/README.md Invoke installed skills using the 'li skill' command. Examples include printing skill output, listing skills, and showing full skill details. ```bash li skill hello # print body to stdout li skill list # list installed skills li skill show hello # print full file (frontmatter + body) ``` -------------------------------- ### Install JIT Grant Hook and Register Gate Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0046-jit-tool-grant.md Mounts Branch-scoped grants and registers the JIT gate through AgentConfig. This function should be called during agent setup to enable JIT authorization for tools. ```python from typing import Any from lionagi.agent.config import AgentConfig from lionagi.session.branch import Branch def install_jit_grant_hook(branch: Branch, config: AgentConfig) -> JITGrantManager: """Mount Branch-scoped grants and register the JIT gate through AgentConfig.""" grants = JITGrantManager( agent_id=str(branch.id), actions=branch.acts, # existing ActionManager logger=branch._log_manager, # existing DataLogger ) branch.metadata.setdefault("governance", {})["jit_grants"] = str(grants.id) config.pre("*", gate_jit_required(grants)) return grants def gate_jit_required(grants: JITGrantManager): """Existing pre-hook signature from lionagi.agent.hooks.""" async def _gate( tool_name: str, action: str, args: dict[str, Any], ) -> dict | None: tool_id = str(args.get("function") or args.get("tool_id") or action or tool_name) tool = grants.actions.registry.get(tool_id) if grants.actions else None governance = getattr(tool, "governance", None) or getattr( tool, "governance_meta", None ) requires_jit = bool(getattr(governance, "requires_jit", False)) safety_class = getattr(governance, "safety_class", "") if not (requires_jit or safety_class == "privileged"): return None agent_id = str(args.get("agent_id") or grants.agent_id) token = grants.find_valid_token( agent_id=agent_id, tool_id=tool_id, arguments=args, ) if token is None: reason = ( f"No valid JIT permit for tool '{tool_id}' / agent '{agent_id}'. " "Call branch.request_permit(tool_id, args) to obtain authorization." ) grants.record_evidence( ApprovalEvidence( principal_id="gate_jit_required", decision="denied", reason=reason, ) ) raise PermissionError(reason) violations = token.scope.constraint_violations(args) if violations: reason = f"Permit constraint violations: {violations}" grants.record_evidence( ApprovalEvidence( principal_id="gate_jit_required", decision="denied", reason=reason, ) ) raise PermissionError(reason) grants.consume_token( token=token, action_request_id=str(args.get("action_request_id", "")), ) return None return _gate ``` -------------------------------- ### Full Lifecycle Sandbox Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/api/sandbox.md Demonstrates the complete lifecycle of using the sandbox: creating a sandbox, running an agent within it, reviewing changes, and either committing/merging or discarding them. Ensure the agent is configured with the correct working directory. ```python from lionagi.agent import AgentConfig, create_agent from lionagi.tools.sandbox import ( create_sandbox, sandbox_diff, sandbox_commit, sandbox_merge, sandbox_discard, ) # 1. Create sandbox forked from current branch session = await create_sandbox("/Users/me/project") # 2. Run an agent confined to the worktree config = AgentConfig.coding(cwd=session.worktree_path) branch = await create_agent(config) await branch.chat("Refactor the auth module into separate files") # 3. Review changes diff = await sandbox_diff(session) print(diff["stat"]) print(f"Changed files: {diff['files_changed']}") # 4a. Accept — commit and merge back await sandbox_commit(session, "refactor: split auth module") result = await sandbox_merge(session) # 4b. Reject — discard all changes, no trace # await sandbox_discard(session) ``` -------------------------------- ### Launch Studio Source: https://github.com/khive-ai/lionagi/blob/main/README.md Start the Lion Studio web UI, including the backend API and React frontend. Use --no-docker to run locally and --dev for frontend hot-reloading. ```bash li studio [start] [--port PORT] [--host HOST] [--frontend-port PORT] [--no-frontend] [--dev] [--no-docker] ``` -------------------------------- ### Initialize Postgres State Backend Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0059-postgres-state-backend.md Use this command to initialize the Postgres state backend. Ensure LIONAGI_STATE_BACKEND and LIONAGI_STATE_DSN are set. ```bash LIONAGI_STATE_BACKEND=postgres \ LIONAGI_STATE_DSN=postgresql://lionagi_admin:...@db:5432/lionagi \ li state init ``` -------------------------------- ### Build and Run Lion Studio (Default) Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/README.md Builds the frontend distribution if stale and starts the uvicorn server. This is the default production mode. ```bash li studio ``` -------------------------------- ### Install Lionagi and Dependencies Source: https://github.com/khive-ai/lionagi/blob/main/docs/cookbook/multi-model-pipeline.md Install the Lionagi library and any necessary dependencies like matplotlib for visualization. Specific model dependencies (e.g., Anthropic Claude or OpenAI Codex) may require separate installation and authentication. ```bash pip install lionagi # or: uv add lionagi pip install matplotlib # only for --show-graph # claude — Option A (subscription): npm install -g @anthropic-ai/claude-code && claude login # Option B (API key): export ANTHROPIC_API_KEY="sk-ant-..." # codex — requires ChatGPT Plus/Pro (not an API key): # npm install -g @openai/codex && codex login ``` -------------------------------- ### Install lionagi with PostgreSQL option Source: https://github.com/khive-ai/lionagi/blob/main/notebooks/persist_to_postgres_supabase.ipynb Install the lionagi library with the necessary dependencies for PostgreSQL support. ```bash uv add "lionagi[postgres]" ``` -------------------------------- ### Play Metadata Example Source: https://github.com/khive-ai/lionagi/blob/main/marketplace/orchestrate/skills/show/procedure.md Example JSON structure for storing metadata about a play's execution. ```json { "worktree": "/path/to/worktree", "branch": "show/topic/play-name", "attempt": 1, "started_at": 1748000000.0, "ended_at": 1748003600.0, "exit_code": 0, "status": "running_complete" } ``` -------------------------------- ### Planning Engine Initialization Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0081-configurable-flow-planning.md Shows how the PlanningEngine.__init__ method exposes role and reactive knobs, and how _plan calls the plan function with dag=True and max_tasks. ```python _plan(..., dag=True, max_tasks=max_ops) ``` -------------------------------- ### SWE-bench Verified Mini Pipeline Overview Source: https://github.com/khive-ai/lionagi/blob/main/benchmarks/orchestration/suites/swebench/README.md Illustrates the workflow for the SWE-bench Verified Mini benchmark, from loading instances to running the coding agent and evaluating with the oracle. It highlights the use of isolated sandboxes and orchestration patterns. ```text load.py 50 real instances → benchmark-agnostic Task (cached locally, no Docker) ↓ runner clone repo @ base_commit into an ISOLATED sandbox → lionagi's OWN coding agent (AgentConfig.coding: reader/editor/bash/search) resolves the issue → git diff = model_patch. Orchestration patterns (single | fanout | flow) coordinate the coder(s). ↓ oracle.py write predictions.jsonl → official `swebench.harness.run_evaluation` applies model_patch + test_patch, runs FAIL_TO_PASS / PASS_TO_PASS. resolved == all FAIL_TO_PASS pass AND all PASS_TO_PASS still pass. ``` -------------------------------- ### Install uv package Source: https://github.com/khive-ai/lionagi/blob/main/scripts/README.md Installs the 'uv' package using pip. This is a prerequisite for running the `concat.py` script. ```bash pip install uv ``` -------------------------------- ### Install Lionagi Marketplace Plugin Source: https://github.com/khive-ai/lionagi/blob/main/marketplace/README.md Installs the Claude Code marketplace plugin and the orchestrate plugin for lionagi. ```bash claude /plugin marketplace add ohdearquant/lionagi claude /plugin install orchestrate@lionagi ``` -------------------------------- ### Example: Two-Branch Research and Synthesis Workflow Source: https://github.com/khive-ai/lionagi/blob/main/docs/api/session.md Demonstrates setting up a session with two branches (researcher and writer), sending findings from the researcher to the writer, and having the writer generate a report. ```python import asyncio import lionagi as li async def main(): session = li.Session() researcher = session.new_branch( system="You are a research specialist.", name="researcher", chat_model=li.iModel(model="gpt-4o"), ) writer = session.new_branch( system="You are a technical writer.", name="writer", chat_model=li.iModel(model="gpt-4o"), ) findings = await researcher.communicate("Summarize key advances in RAG architectures.") session.send(researcher.ln_id, writer.ln_id, findings) await session.sync() msgs = session.receive(writer.ln_id) report = await writer.communicate( f"Write a user-friendly guide based on: {msgs[0].content}" ) print(report) asyncio.run(main()) ``` -------------------------------- ### Bad Commit Message Examples Source: https://github.com/khive-ai/lionagi/blob/main/docs/governance/standards/commit-and-pr-style.md Examples of incorrectly formatted commit messages that violate the established rules. ```text Revolutionary governance overhaul Charter stuff feat: governance stuff (scope missing) ``` -------------------------------- ### SSE Request Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0034-frontend-data-and-state-architecture.md Example of an HTTP request to establish a Server-Sent Events stream for a specific project. ```http GET /api/events?project=all Accept: text/event-stream ``` -------------------------------- ### Agent Configuration Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0047-agent-charter.md Demonstrates how to configure an agent with tools and permissions using AgentConfig. Hooks can also be registered to enforce specific behaviors. ```python from lionagi.agent.config import AgentConfig from lionagi.core.guard import guard_destructive config = AgentConfig( name="pr-reviewer", tools=["reader", "bash"], permissions={"bash.deny": ["git push *", "git commit * "]}, ) config.pre("bash", guard_destructive) ``` -------------------------------- ### LangChain Adapter Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0068-governed-adapter-protocol.md Illustrates the import path and tool name for the LangChain adapter. This adapter supports native async operations via 'ainvoke'. ```text LangChain | `GovernedChain` | `lionagi.adapters.langchain` | `langchain.chain` | Yes (`ainvoke`) | `invoke` via executor | `langchain` ``` -------------------------------- ### Example Output for Branch Communication Source: https://github.com/khive-ai/lionagi/blob/main/README.md This is an example of the expected output from the 'Basic Python Branch Communication' snippet. ```text # output: 1. Coroutines let you write non-blocking I/O without threads. 2. asyncio.gather runs multiple coroutines concurrently under one event loop. 3. async generators stream results lazily, pausing between each yield. ``` -------------------------------- ### Install LlamaIndex Source: https://github.com/khive-ai/lionagi/blob/main/notebooks/react_rag.ipynb Installs the llama_index library, which is essential for building RAG applications. This command should be run in your environment before proceeding. ```python # %pip installm llama_index ``` -------------------------------- ### Create Show Directory and Integration Branch Source: https://github.com/khive-ai/lionagi/blob/main/marketplace/orchestrate/skills/show/procedure.md Sets up the directory for a new show and creates an integration branch based on the latest main branch. ```bash TOPIC="my-feature" SHOW_DIR="${LIONAGI_SHOWS_ROOT:-$HOME/.lionagi/shows}/$TOPIC" mkdir -p "$SHOW_DIR" # Create integration branch (rebased on latest main) git fetch origin git checkout -b "show/$TOPIC/integration" origin/main git push -u origin "show/$TOPIC/integration" ``` -------------------------------- ### Install Lionagi with Rich Extra Source: https://github.com/khive-ai/lionagi/blob/main/docs/getting-started/install.md Install the 'rich' extra for Lionagi to enable richer terminal output formatting. ```bash uv add "lionagi[rich]" ``` -------------------------------- ### Build Lionagi Studio Desktop App Source: https://github.com/khive-ai/lionagi/blob/main/apps/studio/desktop/README.md Commands to build the frontend SPA and the desktop application bundle. Use `cargo build --release` to get just the binary without bundling. ```bash cd apps/studio/frontend && npm run build # build SPA first cd ../desktop/src-tauri cargo tauri build # codesign + DMG # or skip bundling (just the binary): cargo build --release ``` -------------------------------- ### Install Lionagi with Ollama Extra Source: https://github.com/khive-ai/lionagi/blob/main/docs/getting-started/install.md Install the 'ollama' extra for Lionagi to enable local model support through Ollama. ```bash uv add "lionagi[ollama]" ``` -------------------------------- ### Minimal End-to-End Work System Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/adrs/ADR-0064-work-system-integration.md Demonstrates the complete lifecycle of defining a schema, setting up validation rules, registering a worker, and submitting a form for processing. This example covers form filling, validation, task submission, and result retrieval. ```python from lionagi.work import ( FieldSpec, WorkForm, WorkEngine, WorkerDefinition, fill_form, Rule, RuleSet, ) # 1. Define the schema spec = { "fields": { "name": FieldSpec(name="name", type="str", required=True), "age": FieldSpec(name="age", type="int", required=True), } } template = WorkForm(form_id="user_form", title="User Registration", **spec) # 2. Define validation rules rs = RuleSet() rs.add(Rule(rule_id="age_range", field="age", check="range", params={"min": 0, "max": 150})) # 3. Define and register a worker def register_user(form: WorkForm) -> dict: errors = rs.apply_all(form) if errors: raise ValueError(errors) return {"registered": True, "name": form.values["name"]} engine = WorkEngine(name="registration") engine.register_worker( WorkerDefinition( definition_id="register", name="User Registration Worker", input_form="user_form", output_form="registration_result", handler="myapp.workers.register_user", ), handler=register_user, # pass directly to skip dotted-path import ) # 4. Fill, validate, submit form = fill_form(template, {"name": "Alice", "age": 30}) assert form.status == "validated" task_id = engine.submit(form, worker_id="register") result = engine.get_result(task_id) assert result.success # result.value == {"registered": True, "name": "Alice"} ``` -------------------------------- ### Playbook Invocation Example Source: https://github.com/khive-ai/lionagi/blob/main/examples/README.md Demonstrates how to invoke a playbook from the command line, specifying arguments and providing input text. ```bash li play audit --mode security --workers 12 "the auth service" # → model=claude-code/opus-4-7, agent=orchestrator # → prompt = "Run a security audit with 12 parallel workers.\n\nTarget: the auth service" ``` -------------------------------- ### Install Lionagi Package Source: https://github.com/khive-ai/lionagi/blob/main/README.md Install the Lionagi Python package using pip. This is the first step to using the SDK. ```bash pip install lionagi ``` -------------------------------- ### Setup and Imports for Operation Graphs Source: https://github.com/khive-ai/lionagi/blob/main/cookbooks/006_operation_graphs_claim_extraction.ipynb Sets up the environment by importing necessary libraries and defining the target document path. This is the initial step for running the claim validation workflow. ```python # Setup and imports from pathlib import Path from typing import Literal from pydantic import BaseModel, Field from lionagi import Branch, Builder, Session, iModel, types from lionagi.tools.types import ReaderTool # Target document - complex theoretical framework here = Path().cwd() document_path = here / "data" / "006_lion_proof_ch2.md" print("✅ Environment setup complete") print(f"📄 Target: {document_path.name}") print("🎯 Goal: Validate academic claims using coordinated ReAct workflows") ``` -------------------------------- ### Rendered Prompt Example Source: https://github.com/khive-ai/lionagi/blob/main/marketplace/orchestrate/skills/playbook/field-reference.md Illustrates how the `prompt` template is rendered with specific argument values and user input. If no placeholders exist and user input is provided, it's appended after a blank line. ```text Run a dry audit with 8 parallel workers. Strict: False. Target: src/auth/ ``` -------------------------------- ### YAML DSL Configuration Example Source: https://github.com/khive-ai/lionagi/blob/main/docs/governance/standards/dsl-style.md Demonstrates correct indentation, block lists, and quoting for complex DSL configurations. Use this structure for defining constraints with multiple fields. ```yaml constraints: - constraint_id: gate.registry.exact_tool description: "Every tool call must match the ratified registry snapshot." gate_id: verify_in_registry manager_surface: ActionManager enforcement: hard attach: level: action action: tool_call tools: [tool.read_file] evidence: required: [GateResult, ToolCallEvidence] ```