loro-agent 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. loro_agent-0.1.0/.github/workflows/ci.yml +38 -0
  2. loro_agent-0.1.0/.github/workflows/integration.yml +60 -0
  3. loro_agent-0.1.0/.gitignore +20 -0
  4. loro_agent-0.1.0/ARCHITECTURE.md +186 -0
  5. loro_agent-0.1.0/LICENSE +21 -0
  6. loro_agent-0.1.0/PKG-INFO +194 -0
  7. loro_agent-0.1.0/PRD.md +801 -0
  8. loro_agent-0.1.0/README.md +138 -0
  9. loro_agent-0.1.0/docs/README.md +19 -0
  10. loro_agent-0.1.0/docs/artifacts.md +27 -0
  11. loro_agent-0.1.0/docs/cli.md +138 -0
  12. loro_agent-0.1.0/docs/configuration.md +147 -0
  13. loro_agent-0.1.0/docs/getting-started.md +142 -0
  14. loro_agent-0.1.0/docs/local-polaris-iceberg.md +107 -0
  15. loro_agent-0.1.0/docs/memory.md +159 -0
  16. loro_agent-0.1.0/docs/polaris-iceberg.md +69 -0
  17. loro_agent-0.1.0/docs/providers.md +120 -0
  18. loro_agent-0.1.0/docs/release.md +81 -0
  19. loro_agent-0.1.0/docs/roadmap.md +150 -0
  20. loro_agent-0.1.0/docs/safety.md +34 -0
  21. loro_agent-0.1.0/docs/testing.md +69 -0
  22. loro_agent-0.1.0/pyproject.toml +104 -0
  23. loro_agent-0.1.0/src/loro/__init__.py +5 -0
  24. loro_agent-0.1.0/src/loro/__main__.py +4 -0
  25. loro_agent-0.1.0/src/loro/artifacts/__init__.py +1 -0
  26. loro_agent-0.1.0/src/loro/artifacts/briefs.py +54 -0
  27. loro_agent-0.1.0/src/loro/artifacts/common.py +54 -0
  28. loro_agent-0.1.0/src/loro/artifacts/documents.py +58 -0
  29. loro_agent-0.1.0/src/loro/artifacts/presentations.py +80 -0
  30. loro_agent-0.1.0/src/loro/artifacts/spreadsheets.py +66 -0
  31. loro_agent-0.1.0/src/loro/audit.py +42 -0
  32. loro_agent-0.1.0/src/loro/cli.py +1342 -0
  33. loro_agent-0.1.0/src/loro/config.py +159 -0
  34. loro_agent-0.1.0/src/loro/governed_data.py +111 -0
  35. loro_agent-0.1.0/src/loro/memory/__init__.py +1 -0
  36. loro_agent-0.1.0/src/loro/memory/base.py +80 -0
  37. loro_agent-0.1.0/src/loro/memory/drafts.py +61 -0
  38. loro_agent-0.1.0/src/loro/memory/iceberg.py +377 -0
  39. loro_agent-0.1.0/src/loro/memory/local.py +55 -0
  40. loro_agent-0.1.0/src/loro/memory/operations.py +168 -0
  41. loro_agent-0.1.0/src/loro/memory/postgres.py +248 -0
  42. loro_agent-0.1.0/src/loro/memory/proposals.py +83 -0
  43. loro_agent-0.1.0/src/loro/memory/schemas.py +99 -0
  44. loro_agent-0.1.0/src/loro/memory/shared.py +15 -0
  45. loro_agent-0.1.0/src/loro/model_tools.py +132 -0
  46. loro_agent-0.1.0/src/loro/models.py +411 -0
  47. loro_agent-0.1.0/src/loro/permissions.py +53 -0
  48. loro_agent-0.1.0/src/loro/polaris.py +177 -0
  49. loro_agent-0.1.0/src/loro/provider_profiles.py +210 -0
  50. loro_agent-0.1.0/src/loro/providers.py +119 -0
  51. loro_agent-0.1.0/src/loro/runtime.py +264 -0
  52. loro_agent-0.1.0/src/loro/safety.py +59 -0
  53. loro_agent-0.1.0/src/loro/serialization.py +12 -0
  54. loro_agent-0.1.0/src/loro/sessions.py +59 -0
  55. loro_agent-0.1.0/src/loro/tool_runtime.py +377 -0
  56. loro_agent-0.1.0/src/loro/tools/__init__.py +1 -0
  57. loro_agent-0.1.0/src/loro/tools/files.py +56 -0
  58. loro_agent-0.1.0/src/loro/tools/git.py +59 -0
  59. loro_agent-0.1.0/src/loro/tools/shell.py +27 -0
  60. loro_agent-0.1.0/tests/integration/test_polaris_cli_integration.py +17 -0
  61. loro_agent-0.1.0/tests/integration/test_postgres_memory_integration.py +71 -0
  62. loro_agent-0.1.0/tests/test_artifacts.py +44 -0
  63. loro_agent-0.1.0/tests/test_audit.py +17 -0
  64. loro_agent-0.1.0/tests/test_cli.py +585 -0
  65. loro_agent-0.1.0/tests/test_config.py +74 -0
  66. loro_agent-0.1.0/tests/test_governed_data.py +60 -0
  67. loro_agent-0.1.0/tests/test_memory.py +366 -0
  68. loro_agent-0.1.0/tests/test_model_tools.py +48 -0
  69. loro_agent-0.1.0/tests/test_models.py +363 -0
  70. loro_agent-0.1.0/tests/test_providers.py +87 -0
  71. loro_agent-0.1.0/tests/test_runtime.py +152 -0
  72. loro_agent-0.1.0/tests/test_safety.py +22 -0
  73. loro_agent-0.1.0/tests/test_sessions.py +16 -0
  74. loro_agent-0.1.0/tests/test_tool_runtime.py +278 -0
  75. loro_agent-0.1.0/tests/test_tools.py +215 -0
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+
9
+ jobs:
10
+ test:
11
+ name: Python ${{ matrix.python-version }}
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.11", "3.12"]
17
+
18
+ steps:
19
+ - name: Check out repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ cache: "pip"
27
+
28
+ - name: Install package and dev dependencies
29
+ run: python -m pip install -e ".[dev]"
30
+
31
+ - name: Lint
32
+ run: python -m ruff check .
33
+
34
+ - name: Test with coverage
35
+ run: python -m pytest --cov --cov-report=term-missing --cov-report=xml
36
+
37
+ - name: Compile Python files
38
+ run: python -m compileall src tests
@@ -0,0 +1,60 @@
1
+ name: Integration
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ postgres:
7
+ description: "Run Postgres Testcontainers integration tests"
8
+ required: true
9
+ default: "true"
10
+ type: choice
11
+ options: ["true", "false"]
12
+ polaris:
13
+ description: "Run Polaris CLI integration tests against a preconfigured runner"
14
+ required: true
15
+ default: "false"
16
+ type: choice
17
+ options: ["true", "false"]
18
+
19
+ jobs:
20
+ postgres:
21
+ if: ${{ inputs.postgres == 'true' }}
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Check out repository
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.11"
31
+ cache: "pip"
32
+
33
+ - name: Install integration dependencies
34
+ run: python -m pip install -e ".[dev,integration]"
35
+
36
+ - name: Run Postgres integration tests
37
+ env:
38
+ LORO_INTEGRATION_POSTGRES: "1"
39
+ run: python -m pytest -m integration tests/integration/test_postgres_memory_integration.py
40
+
41
+ polaris:
42
+ if: ${{ inputs.polaris == 'true' }}
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - name: Check out repository
46
+ uses: actions/checkout@v4
47
+
48
+ - name: Set up Python
49
+ uses: actions/setup-python@v5
50
+ with:
51
+ python-version: "3.11"
52
+ cache: "pip"
53
+
54
+ - name: Install integration dependencies
55
+ run: python -m pip install -e ".[dev,data]"
56
+
57
+ - name: Run Polaris CLI integration tests
58
+ env:
59
+ LORO_INTEGRATION_POLARIS: "1"
60
+ run: python -m pytest -m integration tests/integration/test_polaris_cli_integration.py
@@ -0,0 +1,20 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .mypy_cache/
8
+ .coverage
9
+ dist/
10
+ build/
11
+ .env
12
+ .env.*
13
+ !.env.example
14
+ .loro/config.local.toml
15
+ .loro/audit.jsonl
16
+ .loro/memory/
17
+ .loro/shared-memory-drafts.jsonl
18
+ .loro/sessions/
19
+ /artifacts/
20
+ *.log
@@ -0,0 +1,186 @@
1
+ # Loro Architecture
2
+
3
+ Loro is a Python CLI agent harness for enterprise coding, governed data access, and productivity artifact generation. Its architecture is intentionally layered so the terminal UX, runtime loop, tools, memory, governance integrations, and artifacts can evolve independently.
4
+
5
+ ## System Context
6
+
7
+ ```mermaid
8
+ flowchart LR
9
+ User["Enterprise user"] --> CLI["Loro CLI / TUI"]
10
+ CLI --> Runtime["Agent runtime"]
11
+ Runtime --> Models["Model provider adapters"]
12
+ Runtime --> Tools["Typed tool registry"]
13
+ Runtime --> Memory["Memory subsystem"]
14
+ Runtime --> Artifacts["Artifact generators"]
15
+ Runtime --> Audit["Audit log"]
16
+ Tools --> Files["File tools"]
17
+ Tools --> Shell["Shell tools"]
18
+ Tools --> Git["Git tools"]
19
+ Tools --> Polaris["Polaris wrapper"]
20
+ Memory --> Local["Local memory"]
21
+ Memory --> Shared["Shared enterprise memory"]
22
+ Shared --> Postgres["Postgres backend"]
23
+ Shared --> Iceberg["Iceberg backend"]
24
+ Polaris --> Catalog["Apache Polaris / Iceberg REST catalog"]
25
+ ```
26
+
27
+ ## Package Layout
28
+
29
+ - `loro.cli`: Typer command surface and command-specific orchestration.
30
+ - `loro.runtime`: task runtime, memory recall, audit events, and session persistence.
31
+ - `loro.config`: layered configuration model and environment overrides.
32
+ - `loro.permissions`: `allow` / `ask` / `deny` policy evaluation.
33
+ - `loro.provider_profiles`: built-in AI provider profile registry.
34
+ - `loro.providers`: provider lookup, validation, and local configuration writer.
35
+ - `loro.tools`: local file, shell, and Git tools, with more tools expected behind typed interfaces.
36
+ - `loro.tool_runtime`: explicit typed runtime tool-call parsing and execution.
37
+ - `loro.artifacts`: document, presentation, spreadsheet, brief, and provenance generators.
38
+ - `loro.memory`: local memory, shared-memory draft storage, schema generation, backend adapters, and shared-memory operations.
39
+ - `loro.polaris`: controlled read-only wrapper around the Polaris CLI.
40
+ - `loro.audit`: JSONL audit event writer.
41
+ - `loro.serialization`: small helpers for JSON-safe CLI output.
42
+ - `loro.sessions`: durable JSON session records.
43
+
44
+ ## Runtime Flow
45
+
46
+ 1. The CLI resolves config from system, user, project, local, `LORO_CONFIG`, and
47
+ `LORO_CONFIG_CONTENT`, then applies managed enterprise overlays last.
48
+ 2. The runtime loads local memory and, when enabled, searches shared enterprise memory for
49
+ relevant cited records.
50
+ 3. The runtime emits `runtime.task_started`.
51
+ 4. Explicit prompt tool directives are executed before the first model call.
52
+ 5. The runtime calls the configured model and parses provider-neutral tool directives from
53
+ the response.
54
+ 6. Approved tool calls are executed, audited, and sent back to the model as structured text.
55
+ 7. The loop repeats until the model responds without tool directives or `[runtime].max_steps`
56
+ is reached.
57
+ 8. The runtime creates a session summary, including tool execution payloads and stop reason,
58
+ and persists it to the configured session store.
59
+ 9. The runtime emits `runtime.task_completed`.
60
+ 10. Artifact and tool commands emit their own audit events with previews and metadata, not full sensitive payloads.
61
+
62
+ The current model-directed loop uses text directives such as
63
+ `@tool {"name": "file.read", "args": {"path": "README.md"}}`. Native provider tool-calling
64
+ can map into the same internal `ToolCall` type as provider adapters mature. The runtime
65
+ registry currently exposes file read/search, local memory search, permission-gated shell
66
+ execution, read-only Polaris passthrough, artifact generation with provenance, approved file
67
+ writes/replacements, and Git status/diff/show/add/commit helpers.
68
+
69
+ ## Configuration
70
+
71
+ Loro config is loaded in increasing precedence:
72
+
73
+ 1. `/etc/loro/config.toml`
74
+ 2. `~/.config/loro/config.toml`
75
+ 3. `.loro/config.toml`
76
+ 4. `.loro/config.local.toml`
77
+ 5. File referenced by `LORO_CONFIG`
78
+ 6. Inline TOML from `LORO_CONFIG_CONTENT`
79
+ 7. Non-overridable managed overlays from `/etc/loro/managed.toml`, `LORO_MANAGED_CONFIG`,
80
+ and `LORO_MANAGED_CONFIG_CONTENT`
81
+
82
+ Managed overlays use the same TOML schema as normal config but are re-applied after runtime
83
+ overrides, making them suitable for enterprise permission denies, audit defaults, shared
84
+ memory policy, and governed data configuration.
85
+
86
+ ## Permissions
87
+
88
+ The permission engine evaluates requests as:
89
+
90
+ - `allow`: tool may execute.
91
+ - `ask`: tool requires an explicit CLI approval flag or future interactive approval.
92
+ - `deny`: tool is blocked.
93
+
94
+ Ordered permission rules can override per-tool defaults with case-insensitive glob matches
95
+ on tool, action, and target. The first matching rule wins.
96
+
97
+ Current examples:
98
+
99
+ - `loro shell run --yes -- python -c "print('ok')"` requires `--yes` when shell policy is `ask`.
100
+ - `loro file read` and `loro file search` are read-only and internally approved for the current CLI command.
101
+ - Runtime file writes, Git mutations, and shell execution require explicit approval unless
102
+ policy sets the relevant action to `allow`.
103
+
104
+ Future work should add richer data-scope matchers.
105
+
106
+ ## AI Providers
107
+
108
+ Provider profiles are stored in `loro.providers`. Profiles capture:
109
+
110
+ - Provider name and display name.
111
+ - Default primary model.
112
+ - Default small/fast model.
113
+ - API key environment variable.
114
+ - Base URL.
115
+ - Protocol family.
116
+ - Notes for special providers.
117
+
118
+ Current profiles cover OpenAI, Anthropic, Gemini, Mistral, Groq, Cerebras, Together AI, Fireworks AI, DeepSeek, xAI, Perplexity, OpenRouter, Nous Portal, OpenCode Zen, OpenCode Go, Azure OpenAI, AWS Bedrock, Ollama, LM Studio, vLLM, and generic OpenAI-compatible endpoints.
119
+
120
+ `loro configure` writes `.loro/config.local.toml`, keeping user-specific provider choices and endpoint details out of source control. `loro providers check` validates required environment variables. `loro providers request` prints a redacted request payload without performing network I/O. `loro.models` contains the request-building adapter layer for mock, OpenAI-compatible, Anthropic, Gemini, Ollama, and optional AWS Bedrock protocols. `loro.model_tools` normalizes native OpenAI-compatible `tool_calls`, Anthropic `tool_use`, Gemini `functionCall`, and Bedrock `toolUse` response payloads into the runtime's provider-neutral tool-call shape. Textual `@tool` directives remain supported for deterministic tests and providers without native tool calling.
121
+
122
+ ## Memory
123
+
124
+ Loro has two memory planes:
125
+
126
+ - Local memory: JSONL-backed today, private to the current environment, searchable by substring.
127
+ - Shared memory: schema-first scaffolding for explicit user-approved enterprise memory.
128
+
129
+ Shared memory writes must stay explicit. The agent can propose a memory, but only
130
+ user-approved text should be staged or committed. Current code supports shared memory schema
131
+ generation, draft records, proposal records, `memory shared-search`, `memory apply-schema`
132
+ SQL dry runs, `memory commit-draft` SQL dry runs, Postgres readiness diagnostics, a Postgres
133
+ adapter that can apply schema, execute explicit draft commits, and execute search when
134
+ `psycopg` plus a DSN are available, and an Iceberg adapter that renders configured DDL plus
135
+ append/search SQL. The Iceberg adapter can also execute search and explicit draft commits
136
+ through a configured PyIceberg catalog, typically a Polaris-governed REST catalog. Runtime
137
+ shared-memory recall includes citations so responses can identify the backend, tenant, scope,
138
+ and memory id.
139
+
140
+ ## Artifact Generation
141
+
142
+ Artifact commands use deterministic Python generators:
143
+
144
+ - Documents: Markdown and DOCX.
145
+ - Presentations: Markdown outline and PPTX.
146
+ - Spreadsheets: XLSX and CSV.
147
+ - Briefs: Markdown.
148
+
149
+ Each artifact write produces a `.provenance.json` sidecar with prompt preview, generated paths, assumptions, timestamp, and generator metadata.
150
+
151
+ ## Polaris And Governed Data
152
+
153
+ The Polaris integration is intentionally controlled:
154
+
155
+ - `loro data catalogs` calls `polaris catalogs list` only when Polaris is enabled.
156
+ - Typed `loro data` commands cover catalog, namespace, table, view, role, privilege, and policy discovery.
157
+ - `loro data polaris ...` validates the resource/action pair against a read-only allowlist before executing.
158
+
159
+ Future work should expose governed table context to the agent loop and add higher-level access explanations.
160
+
161
+ ## Persistence
162
+
163
+ Runtime files are ignored by Git:
164
+
165
+ - `.loro/audit.jsonl`
166
+ - `.loro/memory/`
167
+ - `.loro/sessions/`
168
+ - `artifacts/`
169
+
170
+ This keeps local usage out of source control while preserving inspectable state on disk.
171
+
172
+ ## Testing Strategy
173
+
174
+ The MVP uses focused unit and CLI tests:
175
+
176
+ - Artifact creation and provenance.
177
+ - Audit JSONL writing.
178
+ - Config merge and environment overrides.
179
+ - Local memory search.
180
+ - Session roundtrips.
181
+ - File, shell, and Polaris tool behavior.
182
+ - Typer CLI smoke behavior.
183
+ - Postgres shared-memory SQL rendering and backend readiness checks.
184
+ - Iceberg shared-memory DDL and SQL rendering.
185
+
186
+ Integration tests for real Postgres, Iceberg, Polaris, and model providers should live behind optional test markers once those services are implemented.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alex Merced
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: loro-agent
3
+ Version: 0.1.0
4
+ Summary: Enterprise memory-sharing CLI agent harness for coding, governed data, and productivity work.
5
+ Project-URL: Homepage, https://github.com/alexmerced-oss/loro
6
+ Project-URL: Documentation, https://github.com/alexmerced-oss/loro/tree/main/docs
7
+ Project-URL: Repository, https://github.com/alexmerced-oss/loro
8
+ Project-URL: Issues, https://github.com/alexmerced-oss/loro/issues
9
+ Author: Alex Merced
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,cli,enterprise,iceberg,memory,polaris
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Office/Business
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: System :: Shells
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: httpx>=0.27.0
27
+ Requires-Dist: openpyxl>=3.1.5
28
+ Requires-Dist: pydantic-settings>=2.5.0
29
+ Requires-Dist: pydantic>=2.9.0
30
+ Requires-Dist: python-docx>=1.1.2
31
+ Requires-Dist: python-pptx>=1.0.2
32
+ Requires-Dist: rich>=13.9.0
33
+ Requires-Dist: structlog>=24.4.0
34
+ Requires-Dist: tomli-w>=1.0.0
35
+ Requires-Dist: typer>=0.12.5
36
+ Requires-Dist: xlsxwriter>=3.2.0
37
+ Provides-Extra: artifacts
38
+ Requires-Dist: pandas>=2.2.0; extra == 'artifacts'
39
+ Provides-Extra: aws
40
+ Requires-Dist: boto3>=1.34.0; extra == 'aws'
41
+ Provides-Extra: data
42
+ Requires-Dist: psycopg[binary]>=3.2.0; extra == 'data'
43
+ Requires-Dist: pyarrow>=17.0.0; extra == 'data'
44
+ Requires-Dist: pyiceberg>=0.8.0; extra == 'data'
45
+ Requires-Dist: sqlalchemy>=2.0.35; extra == 'data'
46
+ Provides-Extra: dev
47
+ Requires-Dist: coverage[toml]>=7.6.0; extra == 'dev'
48
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
49
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
50
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
51
+ Requires-Dist: ruff>=0.6.9; extra == 'dev'
52
+ Provides-Extra: integration
53
+ Requires-Dist: psycopg[binary]>=3.2.0; extra == 'integration'
54
+ Requires-Dist: testcontainers[postgres]>=4.8.0; extra == 'integration'
55
+ Description-Content-Type: text/markdown
56
+
57
+ # Loro
58
+
59
+ Loro is a Python CLI agent harness for enterprise coding, governed data work, and productivity tasks.
60
+
61
+ "Loro" is Spanish for parrot: an intelligent, social bird that listens, learns, repeats useful knowledge, and helps information move across groups.
62
+
63
+ ## Install
64
+
65
+ ```bash
66
+ python -m pip install loro-agent
67
+ loro --version
68
+ ```
69
+
70
+ Optional extras:
71
+
72
+ ```bash
73
+ python -m pip install "loro-agent[data]" # Postgres, Iceberg, and PyArrow support
74
+ python -m pip install "loro-agent[aws]" # AWS Bedrock adapter support
75
+ python -m pip install "loro-agent[dev]" # Development and test tools
76
+ ```
77
+
78
+ ## What It Includes
79
+
80
+ - A Typer-powered CLI entrypoint.
81
+ - Configuration loading from system, user, project, local, runtime, and managed enterprise sources.
82
+ - Permission decision primitives.
83
+ - Local and shared memory interfaces.
84
+ - Postgres and Iceberg shared memory adapters with explicit-only shared write flows.
85
+ - PyIceberg execution support for governed Iceberg shared-memory search and draft commits.
86
+ - Polaris client for read-only governed catalog discovery.
87
+ - Artifact generation for Markdown/DOCX documents, PPTX presentations, XLSX/CSV spreadsheets, and Markdown briefs.
88
+ - Artifact provenance sidecars that record prompt previews, generated paths, assumptions, and generator metadata.
89
+ - JSONL audit logging for runtime tasks, memory writes, and artifact creation.
90
+ - Durable session records with `loro sessions list` and `loro sessions show`.
91
+ - Permission-gated file and shell tools.
92
+ - Shared memory draft staging and Postgres/Iceberg schema output.
93
+ - Shared memory backend diagnostics.
94
+ - Safety scanner for obvious secrets before memory and artifact writes.
95
+ - AI provider profiles and `loro configure` setup wizard.
96
+ - Native tool-call normalization for OpenAI-compatible, Anthropic, Gemini, and Bedrock providers.
97
+
98
+ ## Configure A Provider
99
+
100
+ Use the setup wizard or pass options directly:
101
+
102
+ ```bash
103
+ loro providers list
104
+ loro providers show openai
105
+ export OPENAI_API_KEY="<your-key>"
106
+ loro configure --provider openai --model gpt-4.1 --small-model gpt-4.1-mini
107
+ loro providers check openai
108
+ ```
109
+
110
+ For local Ollama:
111
+
112
+ ```bash
113
+ loro configure --provider ollama --model llama3.2 --small-model llama3.2
114
+ ```
115
+
116
+ `loro configure` writes `.loro/config.local.toml` by default. Keep provider secrets in
117
+ environment variables.
118
+
119
+ ## Run Agentic Tasks
120
+
121
+ ```bash
122
+ loro plan "Create a release readiness checklist"
123
+ loro run "Inspect README.md and suggest the next three improvements."
124
+ ```
125
+
126
+ Loro can use typed tools for file reads/searches, approved edits, approved shell commands,
127
+ Git helpers, memory search, Polaris discovery, and artifact creation. Write-like tools are
128
+ permission-gated.
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ python -m venv .venv
134
+ source .venv/bin/activate
135
+ pip install -e ".[dev]"
136
+ loro --help
137
+ python -m pytest
138
+ ```
139
+
140
+ ## Examples
141
+
142
+ ```bash
143
+ loro remember --local "Status briefs should include risks, blockers, next steps, and owner."
144
+ loro remember --shared "Use the enterprise launch readiness template for launches."
145
+ loro memory drafts
146
+ loro memory commit-draft <draft-id>
147
+ loro memory shared-search "launch readiness" --tenant-id acme
148
+ loro memory propose "Use concise launch summaries" --target local
149
+ loro memory propose "Use the enterprise launch readiness template" --target shared
150
+ loro memory accept-proposal <proposal-id>
151
+ loro memory schema --backend postgres
152
+ loro memory backend-check
153
+ loro docs create "Draft a project kickoff document"
154
+ loro slides create "Quarterly platform update"
155
+ loro sheets create "Launch readiness tracker"
156
+ loro brief meeting "Prepare for roadmap sync"
157
+ loro memory search "status briefs"
158
+ loro sessions list
159
+ loro file search "Polaris" --root .
160
+ loro file read PRD.md --limit 1000
161
+ loro shell run --yes -- python -c "print('hello from Loro')"
162
+ loro safety scan "api_key = 'abc123456789'"
163
+ loro providers list
164
+ loro providers show nous-portal
165
+ loro providers check nous
166
+ loro providers request "hello" --provider nous --model hermes-3-405b
167
+ loro configure --provider ollama --model llama3.2 --small-model llama3.2
168
+ loro data schema events --catalog prod --namespace analytics
169
+ loro data explain-access events --catalog prod --namespace analytics --catalog-role reader
170
+ ```
171
+
172
+ Generated files are written to `artifacts/` by default. Use `--output-dir` to choose another location. Each generated artifact also gets a `.provenance.json` sidecar.
173
+
174
+ Configuration can be layered from `.loro/config.toml`, `LORO_CONFIG`, and
175
+ `LORO_CONFIG_CONTENT`. Enterprise-managed overlays can be supplied through
176
+ `/etc/loro/managed.toml`, `LORO_MANAGED_CONFIG`, or `LORO_MANAGED_CONFIG_CONTENT`; those
177
+ managed values are applied last.
178
+
179
+ For shell commands, use `--` before the command when passing flags to the child process.
180
+
181
+ Memory and artifact commands scan for obvious secrets by default. Use `--allow-sensitive` only when enterprise policy allows that content to be persisted.
182
+
183
+ ## Documentation
184
+
185
+ - [Getting Started](docs/getting-started.md)
186
+ - [CLI Guide](docs/cli.md)
187
+ - [Configuration](docs/configuration.md)
188
+ - [AI Providers](docs/providers.md)
189
+ - [Memory](docs/memory.md)
190
+ - [Polaris And Iceberg](docs/polaris-iceberg.md)
191
+
192
+ ## License
193
+
194
+ MIT