-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from AFutureD/feat-ninjia
Using ninjia framework
- Loading branch information
Showing
66 changed files
with
1,921 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/python:3.12", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"GitHub.copilot", | ||
"ms-python.mypy-type-checker", | ||
"ms-python.vscode-pylance", | ||
"ms-python.debugpy", | ||
"charliermarsh.ruff", | ||
"vscode-icons-team.vscode-icons" | ||
] | ||
} | ||
}, | ||
"forwardPorts": [8000], | ||
"postCreateCommand": "pipx install pdm; pdm install;" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SERVER_URL='https://example.com' | ||
|
||
PGHOST='*.neon.tech' | ||
PGDATABASE='db_name' | ||
PGUSER='user_name' | ||
PGPASSWORD='<password>' | ||
|
||
OPENAI_API_KEY='sk-xxx' | ||
|
||
CO_API_KEY='xxxxx' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,66 @@ | ||
# loci | ||
|
||
> The method of loci is a strategy for memory enhancement, | ||
> which uses visualizations of familiar spatial environments in order to enhance the recall of information. | ||
> The method of loci is also known as the memory journey, | ||
> memory palace, journey method, memory spaces, or mind palace technique. | ||
> | ||
> -- wikipedia | ||
# koma | ||
|
||
## Overview | ||
|
||
Notice: This project is still in development. | ||
|
||
This project(`loci`) is designed to help users search for information on macOS. | ||
This project(`koma`) is designed to help users search for information on macOS. | ||
|
||
Specifically thanks to the [apple_cloud_notes_parser](https://github.com/threeplanetssoftware/apple_cloud_notes_parser). | ||
Specifically thanks to the [apple_cloud_notes_parser](https://github.com/threeplanetssoftware/apple_cloud_notes_parser) and [neon](https://neon.tech). | ||
|
||
|
||
## Feature | ||
|
||
in progress: | ||
- [x] [core] List all notes from Notes.app; | ||
- [x] [core] Convert all notes into markdown; | ||
- [ ] [core] Get a specific note; | ||
- [ ] [core] Create a note using AppleScript; | ||
- [x] [api ] Incremental index all notes and its paragraphs; | ||
- [x] [api ] Semantic query in both json and plain text; | ||
- [ ] [api ] Summrize similar content; | ||
- [ ] [api ] Automatic sync Apple notes. | ||
|
||
## Usage | ||
|
||
### As a data connector in RAG platform. | ||
|
||
By using OpenAPI this is easy to intergate into any rag platform, such as [Dify](https://dify.ai). | ||
|
||
In Dify, goto [Tools](https://cloud.dify.ai/tools?category=api) and create one using `<Your Domain>/api/openapi.json`. | ||
|
||
### Raycast | ||
|
||
TODO. | ||
|
||
## Install | ||
|
||
### Step 0: Prepare | ||
|
||
1. You have [pdm](https://pdm-project.org/en/stable/) and [uvicorn](https://www.uvicorn.org) installed. | ||
2. Your Terminal have [Full Disk Access](https://www.perplexity.ai/search/How-to-enable-mOAW4vpVRlmeMvtg6EjnNw) permission. | ||
3. Your Apple Notes.app folder is `~/Library/Group Containers/group.com.apple.notes` | ||
4. Configure the `.env` | ||
|
||
### Step 1: download this project | ||
|
||
``` | ||
> git clone https://github.com/AFutureD/koma.git | ||
``` | ||
|
||
### Step 2: Install dependencies. | ||
|
||
``` | ||
> cd koma | ||
> pdm sync | ||
``` | ||
|
||
- [x] [core] get notes from notes.app | ||
- [x] [core] render notes into markdown | ||
- [x] [core] incremental save notes into database(current mongodb only) | ||
- [x] [cli ] list notes | ||
- [ ] [cli ] get the content of a note from database | ||
- [ ] [cli ] search notes | ||
### Step 3: Run server | ||
|
||
``` | ||
> pdm run django_manage migrate rag | ||
> uvicorn agent.asgi:application --host 0.0.0.0 --env-file ./.env | ||
``` | ||
|
||
TODO: | ||
|
||
- [ ] [core] using pyiCloud. | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .render import RenderAble, TextRenderer | ||
from .model import Model | ||
|
||
__all__ = [ | ||
'Model', 'TextRenderer', 'RenderAble' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from typing import Any | ||
from pydantic import BaseModel, Field | ||
|
||
class Model(BaseModel): | ||
metadata: dict[str, Any] = Field(default=dict(), exclude=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/pkg-core/loci/domain/__init__.py → packages/pkg-core/koma/domain/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.