Skip to content

Commit 7c40f17

Browse files
committed
update: readme
1 parent 96f9bf4 commit 7c40f17

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
![npm downloads](https://img.shields.io/npm/dt/frai)
2222

2323

24-
FRAI is an open-source toolkit that helps teams launch AI features responsibly. It guides you through evidence gathering, scans your code, and assembles documentation you can hand to reviewers: implementation checklists, model cards, risk files, evaluation reports, and compliance-aware RAG indexes. The toolkit ships as two packages that work together:
24+
FRAI is an open-source toolkit that helps teams launch AI features responsibly. It guides you through evidence gathering, scans your code, and assembles documentation you can hand to reviewers: implementation checklists, model cards, risk files, evaluation reports, and compliance-aware RAG indexes. The toolkit ships as three packages that work together:
2525

2626
- `frai` – the command-line app with ready-to-run workflows.
2727
- `frai-core` – the reusable SDK that powers the CLI and any custom integrations.
28+
- `frai-agent` – a LangChain-powered conversational agent for FRAI workflows.
2829

2930
### Short Answer
3031
- `frai-core` is the library/SDK. Use it when you are embedding FRAI capabilities into your own tools, servers, automations, or extensions.
@@ -43,10 +44,12 @@ FRAI is an open-source toolkit that helps teams launch AI features responsibly.
4344
### When to Use Each
4445
- Choose **`frai` (CLI)** when you want interactive prompts, one-command scans, RAG indexing, evaluation reports, or CI-friendly automation without writing code.
4546
- Choose **`frai-core` (SDK)** when you want API access to FRAI capabilities from Node scripts, services, custom CLIs, extensions, or unusual I/O flows.
47+
- Choose **`frai-agent`** when you want a conversational AI assistant that can intelligently orchestrate FRAI workflows using natural language commands.
4648

4749
### Concrete Examples
4850
- CLI user: run `frai --scan` and `frai eval` in a repository to generate governance docs and audit reports.
4951
- Library user: call `Documents.generateDocuments` from an internal portal to produce standardized docs, use `Scanners.scanCodebase` inside a GitHub Action, or embed `Rag.indexDocuments` inside a VS Code extension for grounded hints.
52+
- Agent user: interact with `frai-agent` conversationally: "scan the repo and tell me what risks you found" or "generate docs based on this questionnaire data".
5053

5154
In short: CLI = product; Core = platform. They overlap in capability on purpose but target different audiences and distribution needs.
5255

@@ -183,6 +186,69 @@ Because `frai-core` is a regular ESM package, you can import only the modules yo
183186

184187
---
185188

189+
## Using `frai-agent`
190+
191+
`frai-agent` is a LangChain-powered conversational agent that wraps FRAI scanning and documentation workflows behind a natural language interface. It provides an intelligent assistant that can scan repositories, generate documentation, and answer questions about your AI features.
192+
193+
### Getting Started
194+
195+
From the monorepo root:
196+
```bash
197+
pnpm agent:frai "Scan the repository and summarize AI risks."
198+
```
199+
200+
### Interactive Mode
201+
202+
Launch a chat-style session:
203+
```bash
204+
pnpm agent:frai --interactive --verbose
205+
```
206+
207+
The agent supports two tools:
208+
- **`scan_repository`** – Scans your codebase for AI indicators using FRAI's static detectors.
209+
- **`generate_responsible_ai_docs`** – Generates `checklist.md`, `model_card.md`, and `risk_file.md` from questionnaire answers.
210+
211+
### Example Usage
212+
213+
Scan a repository:
214+
```bash
215+
pnpm agent:frai "Scan the repo and tell me what AI-related code you found."
216+
```
217+
218+
Generate documentation (with questionnaire answers):
219+
```bash
220+
pnpm agent:frai "Generate the docs with these answers: {
221+
\"core\": { \"name\": \"ReviewCopilot\", \"purpose\": \"assistant\" },
222+
\"impact\": { \"stakeholders\": [\"developers\"], \"impactLevel\": \"medium\" },
223+
\"data\": { \"sources\": [\"internal docs\"], \"retention\": \"30 days\" },
224+
\"performance\": { \"metrics\": [\"accuracy\"] },
225+
\"monitoring\": { \"strategy\": \"daily review\" },
226+
\"bias\": { \"mitigations\": [\"red teaming\"] }
227+
}"
228+
```
229+
230+
### API Usage
231+
232+
```ts
233+
import { createFraIAgentExecutor } from "frai-agent";
234+
235+
const executor = await createFraIAgentExecutor({
236+
model: "gpt-4o-mini",
237+
verbose: true
238+
});
239+
240+
const result = await executor.invoke({
241+
input: "scan the repository",
242+
chat_history: []
243+
});
244+
245+
console.log(result.output);
246+
```
247+
248+
`frai-agent` reuses FRAI's configuration system, so it automatically discovers your `OPENAI_API_KEY` from `.env` or global config.
249+
250+
---
251+
186252
## Local Development
187253

188254
Clone the repository and work from source:

0 commit comments

Comments
 (0)