-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor application structure to use Agno #429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 250 commits
2fd41ba
687ae12
a305cac
5f43801
0e1644a
45b756e
211ff0a
566e2b8
bb190ff
4089b97
8e7f6e9
ec36f60
94782cb
24bcb7e
7d08cff
9606556
41bd19f
5ac4212
79e0f2d
25c7df1
5a51ee6
8740343
c8884f0
025c573
f2a34b4
a3f8c7e
1754b84
98d260c
1603800
8632f95
44d5ba2
cd80f8e
b68b8be
6a95c4e
a81c7b7
26a0122
deeed77
96ac58d
3d32905
2491a14
18bb6dd
2cce5c7
4c48a26
2510780
3d6c299
fdf5601
e36bf97
fabfc8c
cb6b4bb
f356cde
608d46d
58bf3e3
cd3e350
ec0e2fb
fde07f8
f2fd5c6
6b7ce15
4912efc
925d9d9
e38147d
4c61246
954240a
a683851
1e76ac5
050ee7d
ea7b1e4
8b54c63
2a81666
2b2083d
5adf7f4
1cd56c4
63b7544
fa8dfd7
2c3ebc8
f43565e
045c1d5
166406b
23a8972
dd75c18
984416c
42a7d57
4fbafa9
bc6ddec
9d31422
6c69cdb
af395c6
cacb55a
0df5c15
f739ffd
0e22e99
693f755
8aa4863
ae953e4
8766546
1e60c85
fceb9f8
d38279d
6faec58
86a1e11
b6702c3
7e4e8d3
f7f93a8
fc2d9cb
f9d72ed
af015c4
a1e8f52
338368e
5735f24
f4409b0
e0fc704
136ac45
5f2819f
c89fea9
6283b3a
d2a001b
331a8a5
2e667e2
812c329
08082b1
3687fa4
bb19a43
87a2f0a
38cd607
caebddc
50489e5
7556026
eef4161
7237cb6
4b4ef3a
6fc96f9
7cf3342
147e9f3
ca536f2
988632a
b394ab4
5b5203a
20db923
07e86fb
28ac340
9b19383
03db5ef
918b76d
2bc872e
c7ecf88
2714bbe
297838b
b1fa441
d72c988
fcaf38d
4ca040e
b03ed86
9c14ee8
af05fd4
c1199a5
1cb1d3b
74587a4
7bedf67
c1f17af
5c9d467
2ecd0cf
c392e3a
698cb51
104b1c1
f324778
c2f4c10
09df17e
a368425
4f3c28f
57958d7
c5e288e
17c8a39
0dfc78b
ba804ee
5b423bc
1a337d7
3fc4918
a0a9ec3
6cb94ca
06a4fbf
352e6ef
459827d
8094916
8451fa4
a565dc7
537387e
f8265d1
d444fa7
eb2df8c
d764e36
9b14ef7
d22d29e
3d88600
4f0b5db
b6390b4
75e3f7e
871a059
6911c1b
3fe04bc
ce5e3b0
c1272a4
dad15d6
d38802a
0b2f1f3
e311195
3d54984
2191941
edb3ee9
6a7455a
e8a9011
ecbb40b
ad8648e
9d96a46
a4c1450
4c73f38
40671ff
feb902c
c1b57b7
0631268
1811b76
a04d8bb
e87a310
a3baaa4
3cc2d55
773aee5
18f4ac4
7ae71f0
8790e01
af8d4aa
2762060
64cc013
a1befc2
9a4120e
dd93772
d1f7d29
7084055
8991431
9be2226
03f71e4
19c65cb
37fcceb
6a12352
0cab0c5
a3bff0c
942d9e7
e168859
a43ae19
fbbab0e
668ceeb
e4722c0
77bbe06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export MODEL__URL=${MODEL__URL:-https://generativelanguage.googleapis.com/v1beta/openai} | ||
| export MODEL__NAME=${MODEL__NAME:-gemini-2.5-flash} | ||
| export MODEL__API_KEY=${GOOGLE_API_KEY} | ||
| export VECTOR_DATABASE__URL=http://localhost:6333 | ||
| export VECTOR_DATABASE__NAME=main | ||
| export CHARACTER__NAME=Napoleon |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * text=auto eol=lf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # Agent Guidelines for Chattr | ||
|
|
||
| [byterover-mcp] | ||
|
|
||
| ## Byterover MCP Server Tools Reference | ||
|
|
||
| There are two main workflows with Byterover tools and recommended tool call strategies that you **MUST** follow precisely. | ||
|
|
||
| ### Onboarding workflow | ||
|
|
||
| If users particularly ask you to start the onboarding process, you **MUST STRICTLY** follow these steps. | ||
|
|
||
| 1. **ALWAYS USE** **byterover-check-handbook-existence** first to check if the byterover handbook already exists. If not, You **MUST** call **byterover-create-handbook** to create the byterover handbook. | ||
| 2. If the byterover handbook already exists, first you **MUST** USE **byterover-check-handbook-sync** to analyze the gap between the current codebase and the existing byterover handbook. | ||
| 3. Then **IMMEDIATELY USE** **byterover-update-handbook** to update these changes to the byterover handbook. | ||
| 4. During the onboarding, you **MUST** use **byterover-list-modules** **FIRST** to get the available modules, and then **byterover-store-modules** and **byterover-update-modules** if there are new modules or changes to existing modules in the project. | ||
|
|
||
| ### Planning workflow | ||
|
|
||
| Based on user request, you **MUST** follow these sequences of tool calls | ||
|
|
||
| 1. If asked to continue an unfinished implementation, **CALL** **byterover-retrieve-active-plans** to find the most relevant active plan. | ||
| 2. **CRITICAL PLAN PERSISTENCE RULE**: Once a user approves a plan, you **MUST IMMEDIATELY CALL** **byterover-save-implementation-plan** to save it. | ||
| 3. Throughout the plan, you **MUST** run **byterover-retrieve-knowledge** several times to retrieve sufficient knowledge and context for the plan's tasks. | ||
| 4. In addition, you might need to run **byterover-search-modules** and **byterover-update-modules** if the tasks require or update knowledge about certain modules. However, **byterover-retrieve-knowledge** should **ALWAYS** be considered **FIRST**. | ||
| 5. **MUST** use **byterover-update-plan-progress** to mark tasks (and then the whole plan) as completed. | ||
| Example: | ||
|
|
||
| - Task: `byterover-update-plan-progress(plan_name="Feature X", task_name="Task 1", is_completed=true)` | ||
| - All done: `byterover-update-plan-progress(plan_name="Feature X", is_completed=true)` | ||
|
|
||
| 6. Then, you might call **byterover-store-knowledge** to save knowledge and experience implemented throughout the plan or in important tasks. | ||
| 7. During the plan's implementation, you **MUST** frequently call **byterover-think-about-collected-information** and **byterover-assess-context-completeness** to make sure you're on the right track and gather sufficient context for the tasks. | ||
|
|
||
| ### Recommended Workflow Sequence | ||
|
|
||
| 1. **MOST IMPORTANT**: **ALWAYS USE** **byterover-retrieve-knowledge** once or several times for **EACH TASK** of the plan to gather necessary context to complete that task. | ||
| 2. **MOST IMPORTANT**: **ALWAYS USE** **byterover-store-knowledge** once or several times to store critical knowledge and context for future implementations | ||
| 3. Over 15 provided tools, **byterover-retrieve-knowledge** and **byterover-store-knowledge** ARE the two main tools, which **MUST** be used regularly. You can use these two main tools outside the two main workflows for retrieval and storage purposes. | ||
| 4. You **MUST** include phrases like **"According to Byterover memory layer"**, **"Based on memory extracted from Byterover"**, **"From Byterover memory tools"**, ... to explicitly showcase that these sources are from **Byterover**. | ||
| 5. **Implementation & Progress Tracking** → Execute implementation following saved plan → Mark tasks complete as you go → Mark entire plan done when all tasks finished. | ||
| 6. You **MUST** use **byterover-update-module** **IMMEDIATELY** on changes to the module's purposes, technical details, or critical insights that essential for future implementations. | ||
|
|
||
| ## Build/Lint/Test Commands | ||
|
|
||
| ### Installation | ||
|
|
||
| ```bash | ||
| uv sync # Install dependencies | ||
| ``` | ||
|
|
||
| ### Building | ||
|
|
||
| ```bash | ||
| uv build # Build source and wheel distributions | ||
| ``` | ||
|
|
||
| ### Linting & Formatting | ||
|
|
||
| ```bash | ||
| trunk fmt --all --no-progress # Auto-format code | ||
| trunk check # Run all linters and checks | ||
| ``` | ||
|
|
||
| ### Testing | ||
|
|
||
| ```bash | ||
| pytest # Run all tests | ||
| pytest tests/test_app.py::test_app # Run single test | ||
| ``` | ||
|
|
||
| ## Code Style Guidelines | ||
|
|
||
| ### General | ||
|
|
||
| - **Line length**: 88 characters | ||
| - **Indentation**: 4 spaces | ||
| - **Quote style**: Double quotes (`"`) | ||
| - **File encoding**: UTF-8 | ||
|
|
||
| ### Imports | ||
|
|
||
| - Use `from __future__ import annotations` when needed | ||
| - Group imports: standard library, third-party, local | ||
| - Use `TYPE_CHECKING` for conditional imports | ||
| - Combine as imports: `from typing import Dict, List` → `from typing import Dict, List` | ||
|
|
||
| ### Type Hints | ||
|
|
||
| - Use type hints for all function parameters and return values | ||
| - Use `Self` for methods returning the same class instance | ||
| - Use `Sequence`, `list`, `dict` instead of bare generics | ||
| - Use `Path` from `pathlib` for file paths | ||
|
|
||
| ### Naming Conventions | ||
|
|
||
| - **Functions/Methods**: `snake_case` | ||
| - **Variables**: `snake_case` | ||
| - **Classes**: `PascalCase` | ||
| - **Constants**: `UPPER_CASE` | ||
| - **Private attributes**: `_leading_underscore` | ||
|
|
||
| ### Error Handling | ||
|
|
||
| - Use specific exception types (e.g., `OSError`, `ValueError`, `ValidationError`) | ||
| - Log errors with appropriate levels (`logger.error`, `logger.warning`) | ||
| - Raise `Error` from gradio for user-facing errors | ||
| - Use try/except blocks with meaningful error messages | ||
|
|
||
| ### Async/Await | ||
|
|
||
| - Use `async def` for coroutines | ||
| - Use `await` for async operations | ||
| - Return `AsyncGenerator` for streaming responses | ||
|
|
||
| ### Documentation | ||
|
|
||
| - Use docstrings for all public functions, classes, and modules | ||
| - Follow Google-style docstring format | ||
| - Document parameters, return values, and exceptions | ||
|
|
||
| ### Logging | ||
|
|
||
| - Import logger from module settings | ||
| - Use appropriate log levels: `debug`, `info`, `warning`, `error` | ||
| - Include relevant context in log messages | ||
|
|
||
| ### Testing Guidelines | ||
|
|
||
| - Use `pytest` framework | ||
| - Test functions named `test_*` | ||
| - Use descriptive assertions | ||
| - Mock external dependencies when needed |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,15 @@ | ||||||
| FROM cgr.dev/chainguard/wolfi-base:latest@sha256:3e3a125c18346ee7b95980be96529d39eb9f799e140aab2b02218a1bd67bfb18 AS builder | ||||||
|
|
||||||
| COPY --from=ghcr.io/astral-sh/uv:latest@sha256:9874eb7afe5ca16c363fe80b294fe700e460df29a55532bbfea234a0f12eddb1 \ | ||||||
| /uv /uvx /usr/bin/ | ||||||
| ARG INSTALL_SOURCE | ||||||
| ARG PYTHON_VERSION | ||||||
|
|
||||||
| # skipcq: DOK-DL3018 | ||||||
| RUN apk add --no-cache build-base git uv | ||||||
MH0386 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| USER nonroot | ||||||
|
|
||||||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||||||
| uv tool install chattr | ||||||
| uv tool install ${INSTALL_SOURCE} --python ${PYTHON_VERSION} | ||||||
|
||||||
| uv tool install ${INSTALL_SOURCE} --python ${PYTHON_VERSION} | |
| uv tool install "$INSTALL_SOURCE" --python "$PYTHON_VERSION" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <poml syntax="markdown"> | ||
| <role speaker="system"> | ||
| You are a helpful assistant who can act and mimic {{character}}'s character and answer questions about the era. | ||
| </role> | ||
| <task speaker="system"> | ||
| Always respond to the user's query by first generating your text answer, then using an MCP to generate audio from that text, and finally using an MCP to create a video from that audio. | ||
| <br /> | ||
| <b>Crucially, your final output MUST include the generated text response, followed by the tool call for the video creation.</b> | ||
| <list> | ||
| <item><b>Personality:</b> Adopt the voice, tone, and perspective of {{character}}.</item> | ||
| <item><b>Knowledge:</b> Answer questions about the {{character}} era, military campaigns, and French history relevant to his life.</item> | ||
| </list> | ||
| <stepwise-instructions> | ||
| <list> | ||
| <item>Understand the user's question and context.</item> | ||
| <item>Gather relevant information and resources.</item> | ||
| <item>Formulate a clear and concise response in {{character}}'s voice.</item> | ||
| <item><b>ALWAYS</b> generate audio from the formulated response using the appropriate MCP.</item> | ||
| <item><b>ALWAYS</b> create a video file from the generated audio using the appropriate MCP.</item> | ||
| </list> | ||
| </stepwise-instructions> | ||
| </task> | ||
| <output-format> | ||
| Your response structure MUST be: | ||
| <list> | ||
| <item><b>[{{character}}'s Text Response]</b></item> | ||
| <item><b>[Tool Call to generate the video, which implicitly includes the audio generation step]</b></item> | ||
| </list> | ||
| </output-format> | ||
| </poml> |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,22 +1,25 @@ | ||||||||||
| name: Chattr | ||||||||||
| services: | ||||||||||
| chattr: | ||||||||||
| image: ghcr.io/alphaspheredotai/chattr:latest@sha256:a5e93af402616faa006b0add9675e6101708aa94d90ddf35ff133631cfae78fd | ||||||||||
| image: alphaspheredotai/chattr:latest | ||||||||||
|
||||||||||
| image: alphaspheredotai/chattr:latest | |
| image: alphaspheredotai/chattr@sha256:REPLACE_WITH_ACTUAL_DIGEST |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Environment variables with default values use the ${VAR:-default} syntax, but this won't work in all contexts. The colon-dash syntax is shell-specific. If these environment variables are read by Docker or other tools that don't support this syntax, it may fail. Consider documenting this requirement or using a more portable approach.
| MODEL__URL: ${MODEL__URL:-https://generativelanguage.googleapis.com/v1beta/openai} | |
| MODEL__NAME: ${MODEL__NAME:-gemini-2.5-flash} | |
| MODEL__URL: https://generativelanguage.googleapis.com/v1beta/openai | |
| MODEL__NAME: gemini-2.5-flash |
Uh oh!
There was an error while loading. Please reload this page.