beyin 0.2.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 (51) hide show
  1. beyin-0.2.0/.github/ISSUE_TEMPLATE/pack-submission.yml +48 -0
  2. beyin-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +7 -0
  3. beyin-0.2.0/.github/workflows/python-publish.yml +54 -0
  4. beyin-0.2.0/.gitignore +22 -0
  5. beyin-0.2.0/.python-version +1 -0
  6. beyin-0.2.0/CONTRIBUTING.md +95 -0
  7. beyin-0.2.0/PKG-INFO +414 -0
  8. beyin-0.2.0/README.md +392 -0
  9. beyin-0.2.0/REGISTRY-FORMAT.md +83 -0
  10. beyin-0.2.0/beyin/__init__.py +3 -0
  11. beyin-0.2.0/beyin/audio_pipeline.py +92 -0
  12. beyin-0.2.0/beyin/authoring.py +241 -0
  13. beyin-0.2.0/beyin/build_report.py +183 -0
  14. beyin-0.2.0/beyin/chunker.py +63 -0
  15. beyin-0.2.0/beyin/cli.py +2331 -0
  16. beyin-0.2.0/beyin/config.py +236 -0
  17. beyin-0.2.0/beyin/downloader.py +369 -0
  18. beyin-0.2.0/beyin/embedder.py +55 -0
  19. beyin-0.2.0/beyin/ingester.py +378 -0
  20. beyin-0.2.0/beyin/interactive.py +710 -0
  21. beyin-0.2.0/beyin/inventory.py +586 -0
  22. beyin-0.2.0/beyin/lifecycle.py +23 -0
  23. beyin-0.2.0/beyin/machine_output.py +197 -0
  24. beyin-0.2.0/beyin/mcp_server.py +380 -0
  25. beyin-0.2.0/beyin/pack_state.py +292 -0
  26. beyin-0.2.0/beyin/paths.py +27 -0
  27. beyin-0.2.0/beyin/payloads.py +372 -0
  28. beyin-0.2.0/beyin/query.py +281 -0
  29. beyin-0.2.0/beyin/readiness.py +93 -0
  30. beyin-0.2.0/beyin/settings.py +140 -0
  31. beyin-0.2.0/beyin/source_ids.py +111 -0
  32. beyin-0.2.0/beyin/store.py +69 -0
  33. beyin-0.2.0/beyin/transcriber.py +89 -0
  34. beyin-0.2.0/beyin/ui.py +300 -0
  35. beyin-0.2.0/pyproject.toml +49 -0
  36. beyin-0.2.0/scripts/update_index.py +37 -0
  37. beyin-0.2.0/tests/__init__.py +0 -0
  38. beyin-0.2.0/tests/conftest.py +284 -0
  39. beyin-0.2.0/tests/test_cli_build.py +1974 -0
  40. beyin-0.2.0/tests/test_cli_help.py +134 -0
  41. beyin-0.2.0/tests/test_cli_inventory.py +608 -0
  42. beyin-0.2.0/tests/test_cli_lifecycle.py +535 -0
  43. beyin-0.2.0/tests/test_cli_packs.py +288 -0
  44. beyin-0.2.0/tests/test_cli_query.py +398 -0
  45. beyin-0.2.0/tests/test_cli_remove.py +94 -0
  46. beyin-0.2.0/tests/test_cli_setup.py +596 -0
  47. beyin-0.2.0/tests/test_cli_traceability.py +19 -0
  48. beyin-0.2.0/tests/test_ingester.py +139 -0
  49. beyin-0.2.0/tests/test_mcp_server.py +832 -0
  50. beyin-0.2.0/tests/test_query.py +212 -0
  51. beyin-0.2.0/uv.lock +3574 -0
@@ -0,0 +1,48 @@
1
+ name: Submit a Pack
2
+ description: Request a new pack to be added to the beyin registry
3
+ title: "[Pack] "
4
+ labels: ["pack-submission"]
5
+ body:
6
+ - type: input
7
+ id: name
8
+ attributes:
9
+ label: Pack name
10
+ placeholder: e.g. My Favorite Tech Podcast, Best Cooking Blog, AI Research Papers
11
+ validations:
12
+ required: true
13
+
14
+ - type: textarea
15
+ id: description
16
+ attributes:
17
+ label: Description
18
+ placeholder: What is this pack about? Who is it for?
19
+ validations:
20
+ required: true
21
+
22
+ - type: textarea
23
+ id: sources
24
+ attributes:
25
+ label: Sources
26
+ description: YouTube video URLs or blog/article URLs — one per line
27
+ placeholder: |
28
+ https://youtube.com/watch?v=...
29
+ https://example.com/blog/post
30
+ validations:
31
+ required: true
32
+
33
+ - type: input
34
+ id: tags
35
+ attributes:
36
+ label: Tags
37
+ description: Comma-separated
38
+ placeholder: e.g. ai, podcast, science
39
+ validations:
40
+ required: false
41
+
42
+ - type: input
43
+ id: author
44
+ attributes:
45
+ label: Your username
46
+ placeholder: e.g. @username
47
+ validations:
48
+ required: false
@@ -0,0 +1,7 @@
1
+ ## What does this PR do?
2
+
3
+ ## Why?
4
+
5
+ ## Testing
6
+ - [ ] Tests pass (`uv run pytest`)
7
+ - [ ] Tested manually
@@ -0,0 +1,54 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ release-build:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - name: Check out repository
16
+ uses: actions/checkout@v5
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.x"
22
+
23
+ - name: Build release distributions
24
+ run: |
25
+ python -m pip install --upgrade pip build
26
+ python -m build
27
+
28
+ - name: Upload release distributions
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: release-dists
32
+ path: dist/
33
+
34
+ pypi-publish:
35
+ runs-on: ubuntu-latest
36
+ needs:
37
+ - release-build
38
+ permissions:
39
+ id-token: write
40
+ environment:
41
+ name: pypi
42
+ url: https://pypi.org/project/beyin/
43
+
44
+ steps:
45
+ - name: Download release distributions
46
+ uses: actions/download-artifact@v5
47
+ with:
48
+ name: release-dists
49
+ path: dist/
50
+
51
+ - name: Publish release distributions to PyPI
52
+ uses: pypa/gh-action-pypi-publish@release/v1
53
+ with:
54
+ packages-dir: dist/
beyin-0.2.0/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+
2
+ .claude/
3
+ # Python
4
+ __pycache__/
5
+ .pytest_cache/
6
+ .uv-cache/
7
+ *.py[cod]
8
+ *.pyo
9
+ .venv/
10
+ *.egg-info/
11
+ dist/
12
+ build/
13
+
14
+ # macOS
15
+ .DS_Store
16
+
17
+ # packs data
18
+ chroma/
19
+
20
+
21
+ # Env
22
+ .env
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,95 @@
1
+ # Contributing to beyin
2
+
3
+ ## Adding a pack to the registry
4
+
5
+ Submitting a pack is simple: open a [Pack Submission issue](../../issues/new?template=pack-submission.yml), paste the sources, add a short description, and submit it. No fork or code required.
6
+
7
+ If the pack is a good fit, it will be added to the registry.
8
+
9
+ Maintainers can refer to [REGISTRY-FORMAT.md](REGISTRY-FORMAT.md) for the final pack file structure, versioning, and registry metadata format.
10
+
11
+ ### What makes a good pack
12
+
13
+ - Focused on a clear topic or creator
14
+ - Sources are public and unlikely to disappear
15
+ - Description tells users what they'll be able to ask about
16
+ - Tags help people discover it
17
+
18
+ ### What to prepare
19
+
20
+ - A clear pack name
21
+ - A short description
22
+ - Public source URLs
23
+ - A few tags if relevant
24
+
25
+ ### Test locally before submitting
26
+
27
+ The easiest way is through an AI agent with beyin's MCP server — just say "add this pack, build it, and ask it a test question" and it handles everything.
28
+
29
+ Or via terminal:
30
+
31
+ ```bash
32
+ beyin add ./packs/your-pack-id.yaml
33
+ beyin build your-pack-id
34
+ beyin query your-pack-id "test question"
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Contributing code
40
+
41
+ 1. Fork the repo
42
+ 2. Create a branch
43
+ 3. Make your changes and run tests: `uv run pytest`
44
+ 4. Open a PR — the template will guide you
45
+
46
+ For larger changes, open an issue first to discuss the approach.
47
+
48
+ ---
49
+
50
+ ## Policy
51
+
52
+ Packs in this repository contain only source manifests and metadata. beyin does not host third-party content, and all retrieval, transcription, indexing, and embedding happen locally on the user's own machine.
53
+
54
+ ### Allowed
55
+
56
+ - Public YouTube videos and playlists
57
+ - Public articles, websites, and RSS feeds
58
+ - Metadata such as descriptions, tags, and contributor info
59
+
60
+ ### Not allowed
61
+
62
+ - Full copied article text or transcripts without permission
63
+ - Uploaded audio or video files you do not own
64
+ - Paywalled, private, login-protected, or restricted content
65
+ - Credentials, tokens, cookies, or session data
66
+ - User-built embeddings or vector indexes inside packs
67
+
68
+ References are fine. Hosted copies of third-party content are not.
69
+
70
+ ### By submitting
71
+
72
+ - You confirm the sources are public or otherwise permitted to reference
73
+ - You are not copying content you do not have permission to share
74
+ - The information is accurate to the best of your knowledge
75
+
76
+ ### We may remove packs that
77
+
78
+ - Spread malware or harmful material
79
+ - Impersonate creators or brands
80
+ - Use misleading descriptions
81
+ - Reference illegal content
82
+ - Primarily reproduce or mirror third-party content
83
+
84
+ ### Preferred sources
85
+
86
+ - publicly accessible sources
87
+ - first-party documentation
88
+ - open-source content
89
+ - Creative Commons or other openly licensed material
90
+
91
+ ### Removal requests
92
+
93
+ If you are a creator or rights holder and believe a pack references your content in a way that causes harm, contact us. We may review, edit, or remove the pack as appropriate.
94
+
95
+ Maintainers may reject or remove packs at their discretion.
beyin-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,414 @@
1
+ Metadata-Version: 2.4
2
+ Name: beyin
3
+ Version: 0.2.0
4
+ Summary: Build local, queryable packs from videos, articles, podcasts, and files for MCP and local LLM use.
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: chromadb>=1.5.5
7
+ Requires-Dist: faster-whisper>=1.0
8
+ Requires-Dist: feedparser>=6.0
9
+ Requires-Dist: inquirerpy>=0.3.4
10
+ Requires-Dist: mcp>=1.12.4
11
+ Requires-Dist: mlx-whisper>=0.4; sys_platform == 'darwin'
12
+ Requires-Dist: nltk>=3.8
13
+ Requires-Dist: openai>=2.26.0
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: send2trash>=1.8
16
+ Requires-Dist: sentence-transformers>=5.2.3
17
+ Requires-Dist: tiktoken>=0.7
18
+ Requires-Dist: trafilatura>=2.0.0
19
+ Requires-Dist: typer>=0.24.1
20
+ Requires-Dist: yt-dlp>=2025.11.12
21
+ Description-Content-Type: text/markdown
22
+
23
+ <div align="center">
24
+
25
+ # beyin
26
+
27
+ **Build local, queryable packs from text extracted from videos, articles, podcasts, and local files. Query them through MCP with your AI agent, or use a local model to explore them directly.**
28
+
29
+ [![PyPI](https://img.shields.io/pypi/v/beyin?style=for-the-badge)](https://pypi.org/project/beyin/)
30
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/downloads/)
31
+ [![MCP](https://img.shields.io/badge/MCP-compatible-6f42c1?style=for-the-badge)](https://modelcontextprotocol.io)
32
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
33
+
34
+ </div>
35
+
36
+ ## What is beyin?
37
+
38
+ beyin is a local-first tool for turning useful information into queryable knowledge packs.
39
+
40
+ Useful information shows up everywhere, but it rarely stays usable.
41
+
42
+ You come across valuable information worth keeping, but it remains tied to the format where you found it. A video contains insights you want to reference later. An article has details you may want to use again. A saved post, note, or file can hold something important long after you first saw it.
43
+
44
+ beyin was built to turn that scattered information into something structured, local, and queryable through your AI agent, so the useful parts stay accessible whenever you need them.
45
+
46
+ ## ✨ Features
47
+
48
+ - 🎯 Multi-query expansion — generates query variants for better retrieval
49
+ - 📦 Local-first — everything stays on your machine, nothing sent externally
50
+ - 🔗 MCP compatible — works with Claude Code, Codex, Cursor, Windsurf, Zed and more
51
+ - 🌍 50+ languages — multilingual embedding model out of the box
52
+ - 🎬 Rich source support — YouTube, podcasts, PDFs, articles, local files
53
+ - 🤖 Ollama support — use fully offline with a local model
54
+ - ⚡ No dashboard — manage everything by just talking to your agent
55
+
56
+
57
+ ## **How it works**
58
+
59
+ The easiest way to use beyin is through MCP with the AI agent you already use.
60
+
61
+ 1. Build a pack from your sources
62
+ 2. Connect beyin to your agent through MCP
63
+ 3. Ask questions naturally — your agent handles retrieval from your packs automatically
64
+
65
+ Once connected, you do not need to run commands or manage packs manually in the terminal. You can ask your agent to:
66
+
67
+ - create, build, update and manage packs
68
+ - add new sources to a pack by providing URLs or local files
69
+ - check your local packs and their status
70
+ - check available packs in the pack hub
71
+ - retrieve relevant results in response to your questions
72
+
73
+ You can also query packs directly with a local model, no external API or agent needed. See [Query with a Local Model](#query-with-a-local-model).
74
+
75
+ #### Supported Sources
76
+
77
+ | Type | Examples |
78
+ |------|----------|
79
+ | Web articles | Any public URL |
80
+ | YouTube | Videos and playlists |
81
+ | Podcasts | RSS feed URLs |
82
+ | Local text | `.txt`, `.md`, `.rst`, `.html` |
83
+ | Local documents | `.pdf`, `.docx`, `.pptx`, `.epub`, `.xlsx`, `.csv` (optional deps) |
84
+ | Local audio | `.mp3`, `.m4a`, `.wav` |
85
+ | Local video | `.mp4`, `.mov`, `.mkv`, `.webm` |
86
+
87
+ > beyin is built for local processing on your own machine. Use it with content you are allowed to process, preferably public, permitted sources or material you own or have rights to use. Avoid copied, paywalled, private, restricted, or illegally shared content.
88
+
89
+ ---
90
+
91
+ ## Quick Start
92
+
93
+ ### Step 1: Install
94
+
95
+ ```bash
96
+ pip install beyin
97
+ ```
98
+
99
+ Verify your setup:
100
+
101
+ ```bash
102
+ beyin check-deps
103
+ ```
104
+
105
+ **Only needed for video and audio sources. Skip if you only use articles and local text:**
106
+
107
+ **yt-dlp** (any OS):
108
+ ```bash
109
+ pip install yt-dlp
110
+ ```
111
+
112
+ **ffmpeg:**
113
+ ```bash
114
+ # macOS with Homebrew
115
+ brew install ffmpeg
116
+
117
+ # Linux
118
+ sudo apt install ffmpeg
119
+
120
+ # Windows
121
+ winget install ffmpeg
122
+ ```
123
+
124
+ No Homebrew on macOS or winget not working? Download directly from [ffmpeg.org/download.html](https://ffmpeg.org/download.html).
125
+
126
+ ---
127
+
128
+ ### Step 2: Connect to your agent
129
+
130
+ You only need to do this once.
131
+
132
+ #### Claude Code
133
+
134
+ ```bash
135
+ claude mcp add beyin -- beyin mcp-server
136
+ ```
137
+
138
+ No config file editing needed, and **no need to keep a terminal open**. Claude Code launches and manages the server process automatically. Restart Claude Code and `beyin` will appear in your MCP tools.
139
+
140
+ To make it available across all your projects:
141
+
142
+ ```bash
143
+ claude mcp add --scope user beyin -- beyin mcp-server
144
+ ```
145
+
146
+ #### Codex (OpenAI)
147
+
148
+ ```bash
149
+ codex mcp add beyin -- beyin mcp-server
150
+ ```
151
+
152
+ #### Cursor
153
+
154
+ Open or create `~/.cursor/mcp.json` and add:
155
+
156
+ ```json
157
+ {
158
+ "beyin": {
159
+ "command": "beyin",
160
+ "args": ["mcp-server"]
161
+ }
162
+ }
163
+ ```
164
+
165
+ Or go to Command Palette → **"View: Open MCP Settings"**.
166
+
167
+ #### Windsurf
168
+
169
+ Open or create `~/.codeium/windsurf/mcp_config.json` and add:
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "beyin": {
175
+ "command": "beyin",
176
+ "args": ["mcp-server"]
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ Or go to Command Palette → **"MCP: Add Server"**.
183
+
184
+ #### Zed
185
+
186
+ In `~/.config/zed/settings.json`:
187
+
188
+ ```json
189
+ {
190
+ "context_servers": {
191
+ "beyin": {
192
+ "source": "custom",
193
+ "command": "beyin",
194
+ "args": ["mcp-server"]
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ #### Google Antigravity
201
+
202
+ Go to **Manage MCP Servers** → **View raw config** and add:
203
+
204
+ ```json
205
+ {
206
+ "mcpServers": {
207
+ "beyin": {
208
+ "command": "beyin",
209
+ "args": ["mcp-server"]
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ #### Any other MCP-compatible agent
216
+
217
+ The command is `beyin mcp-server`. It runs a stdio MCP server, compatible with any agent that supports the MCP protocol.
218
+
219
+ ---
220
+
221
+ ## Example Usage with MCP
222
+
223
+ Once beyin is connected through MCP, you can talk to your agent naturally. You do not need to memorize commands or even say "beyin" every time. Just ask for what you want, and your agent can handle the pack workflow behind the scenes.
224
+
225
+ > Some prompts that mention local files or folders, such as your Documents or Downloads folder, may require your AI agent to have read access to those locations first.
226
+
227
+ | What you want | What to say |
228
+ |---------------|-------------|
229
+ | Check your packs | `List my beyin packs and show me their status.` |
230
+ | Ask about a pack | `What's in my "mobile-marketing" pack? Show me the sources too.` |
231
+ | Ask a question about a pack | `Any useful info about onboarding screens in my "mobile-marketing" pack?` |
232
+ | Build a new pack | `Create a new pack called "ai-helper-tools" and add this URL I found: https://.... Then build the pack.` |
233
+ | Add a source to an existing pack | `I have a useful PDF about how to automate my app builds. It's in my Documents folder. Add it to the "ai-helper-tools" pack and rebuild it.` |
234
+ | Remove a source from a pack | `Show me the sources in "mobile-marketing", then remove source 2 from that pack.` |
235
+ | Manage the response | `Ask the "ai-helper-tools" pack what I should do about designing a new landing page. Include sources in the response and any timestamps if they exist.` |
236
+ | Remove a pack | `Remove that pack about mobile marketing stuff.` |
237
+
238
+ ---
239
+
240
+ ## MCP Tools Reference
241
+
242
+ These are the tools beyin exposes to your agent. Your agent uses them automatically. You do not need to call them yourself.
243
+
244
+ | Tool | What it does |
245
+ |------|-------------|
246
+ | `packs` | List all installed packs |
247
+ | `status` | Show details and readiness for a pack |
248
+ | `retrieve` | Return relevant results for a query |
249
+ | `add` | Add a pack from a path, URL, or YAML |
250
+ | `add_sources` | Append new sources to a pack and rebuild |
251
+ | `remove_sources` | Remove one or more sources from a pack |
252
+ | `build` | Build or update a pack |
253
+ | `remove` | Remove an installed pack |
254
+
255
+ ---
256
+
257
+ ## All Commands
258
+
259
+ | Command | What it does |
260
+ |---------|-------------|
261
+ | `beyin create` | Create a new pack interactively |
262
+ | `beyin add <path-or-url>` | Import an existing pack from a file or URL |
263
+ | `beyin build <pack>` | Build or rebuild a pack |
264
+ | `beyin update <pack>` | Update a pack with new content |
265
+ | `beyin remove <pack>` | Remove a pack |
266
+ | `beyin list` | List all installed packs |
267
+ | `beyin status <pack>` | Show pack details and readiness |
268
+ | `beyin query <pack> "question"` | Ask a question directly (requires Ollama) |
269
+ | `beyin add-source <pack> <source>` | Add a new source to an installed pack |
270
+ | `beyin remove-source <pack> <selector>` | Remove a source from an installed pack by index or text match |
271
+ | `beyin mcp-server` | Start the MCP server |
272
+ | `beyin settings` | View and configure settings |
273
+ | `beyin check-deps` | Verify runtime dependencies |
274
+ | `beyin about` | Version and info |
275
+ | `beyin help` | List all commands |
276
+
277
+ ---
278
+
279
+ ## Query with a Local Model
280
+
281
+ You can query your packs with a local model using Ollama, without sending anything to an external API. Everything stays on your machine.
282
+
283
+ > **If you use beyin through an MCP-connected agent (Claude Code, Codex, etc.), you do not need Ollama.** Your agent is the LLM. beyin just retrieves results for it.
284
+
285
+ **Setup:**
286
+
287
+ 1. Download and install Ollama from [ollama.com](https://ollama.com)
288
+ 2. Pull a model:
289
+
290
+ ```bash
291
+ ollama pull llama3.2 # 2 GB, fast, good for most queries
292
+ ollama pull qwen2.5:7b # 4.7 GB, stronger reasoning
293
+ ```
294
+
295
+ 3. Start Ollama in a terminal and keep it running:
296
+
297
+ ```bash
298
+ ollama serve
299
+ ```
300
+
301
+ 4. In another terminal, build a pack and query it:
302
+
303
+ ```bash
304
+ beyin query my-pack "What does this source say about X?"
305
+ ```
306
+
307
+ To change the model, run `beyin settings`.
308
+
309
+ ---
310
+
311
+ ## Troubleshooting
312
+
313
+ ### Pack is not queryable yet
314
+
315
+ ```bash
316
+ beyin status my-pack
317
+ beyin build my-pack
318
+ ```
319
+
320
+ A `partial` pack may still be usable. Rebuilding recovers any failed sources.
321
+
322
+ ### MCP is connected but retrieval is not working
323
+
324
+ - Make sure the pack was built: `beyin status my-pack`
325
+ - Restart your agent after adding beyin for the first time
326
+ - Verify the server is registered: `claude mcp list`
327
+ - Make sure the same beyin installation is used by both CLI and the MCP server
328
+
329
+ ### Video or audio builds fail
330
+
331
+ - Check that `ffmpeg` is installed: `ffmpeg -version`
332
+ - Check that `yt-dlp` is installed and current: `yt-dlp --version`
333
+ - Make sure the source URL is still reachable
334
+
335
+ ### Which `python` / `pip` should I use?
336
+
337
+ Use the same Python environment for installation and for the MCP server. If you installed with `pip install beyin`, running `beyin mcp-server` will use that same environment automatically.
338
+
339
+ ---
340
+
341
+ ## Development (from the repo)
342
+
343
+ ```bash
344
+ git clone https://github.com/buralog/beyin.git
345
+ cd beyin
346
+ uv sync
347
+ ```
348
+
349
+ Run commands from the repo:
350
+
351
+ ```bash
352
+ uv run python -m beyin.cli help
353
+ ```
354
+
355
+ MCP config for a local repo install:
356
+
357
+ ```bash
358
+ claude mcp add beyin -- uv run python -m beyin.cli mcp-server --cwd /absolute/path/to/beyin
359
+ ```
360
+
361
+ Or manually in your agent's config file:
362
+
363
+ ```json
364
+ {
365
+ "mcpServers": {
366
+ "beyin": {
367
+ "command": "uv",
368
+ "args": ["run", "python", "-m", "beyin.cli", "mcp-server"],
369
+ "cwd": "/absolute/path/to/beyin"
370
+ }
371
+ }
372
+ }
373
+ ```
374
+
375
+ Run tests:
376
+
377
+ ```bash
378
+ uv run pytest tests/test_cli.py tests/test_mcp_server.py
379
+ ```
380
+
381
+ ---
382
+
383
+ ## Behind the Scenes
384
+
385
+ 1. beyin fetches or loads your source content
386
+ 2. It extracts text or generates transcripts (for audio/video)
387
+ 3. It chunks the content into indexed segments
388
+ 4. It embeds those chunks into a local vector store
389
+ 5. At query time, it retrieves the best-matching results
390
+
391
+ Everything is local. No data is sent anywhere. Packs are just files on your disk.
392
+
393
+ beyin uses a multilingual embedding model by default, so it works well for non-English content too, not just English sources.
394
+
395
+ ---
396
+
397
+ ## Contributing
398
+
399
+ Issues and pull requests are welcome at [github.com/buralog/beyin](https://github.com/buralog/beyin).
400
+
401
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for pack submissions, pack policy, and code contribution guidelines.
402
+
403
+ ---
404
+
405
+ ## Legal
406
+
407
+ beyin does not host, publish, or redistribute third-party content. Public packs contain only source manifests and metadata. Any retrieval, transcription, indexing, or embedding of source material happens locally on the end user's own machine.
408
+
409
+ Users are responsible for ensuring that their use of beyin complies with applicable laws, copyright rules, and the terms of service of the source platforms.
410
+
411
+
412
+ ## License
413
+
414
+ MIT