feat(business): add Kingdee fact queries
Add a structured business facts SQLite layer for Kingdee sales orders, with fixed-template query commands for monthly order counts, sales amount, top customers, and customer trend data. Update README, SETUP, and developer docs to describe configuration, sync commands, query examples, and the boundary between structured facts and wiki ingest. Validation: python3 -m unittest discover -v
This commit is contained in:
@@ -126,6 +126,9 @@ Knowledge that's project-specific goes under `projects/<name>/`. Knowledge that'
|
||||
| Variable | What it does | Default |
|
||||
|---|---|---|
|
||||
| `OBSIDIAN_SOURCES_DIR` | Directories with docs to ingest (comma-separated) | *(empty — point agent at specific files)* |
|
||||
| `OBSIDIAN_BUSINESS_FACTS_DB` | Optional path for structured business facts such as Kingdee orders | `<vault>/_meta/business-facts.sqlite` |
|
||||
| `KINGDEE_API_URL` | JSON endpoint used by `obsidian-wiki business sync kingdee` when `--input` is omitted | *(unset)* |
|
||||
| `KINGDEE_API_TOKEN` | Bearer token for the Kingdee-compatible endpoint | *(unset)* |
|
||||
| `OBSIDIAN_CATEGORIES` | Wiki page categories | `concepts,entities,skills,references,synthesis,journal` |
|
||||
| `OBSIDIAN_MAX_PAGES_PER_INGEST` | Max pages updated per ingest | `15` |
|
||||
| `CLAUDE_HISTORY_PATH` | Where to find Claude data | *auto-discovers from `~/.claude`* |
|
||||
@@ -152,6 +155,18 @@ Knowledge that's project-specific goes under `projects/<name>/`. Knowledge that'
|
||||
| `wiki-update` | Sync current project's knowledge into the vault (works from any project) |
|
||||
| `skill-creator` | Create new skills to extend the framework |
|
||||
|
||||
## Business Facts
|
||||
|
||||
Use the business fact database for exact operational questions, for example monthly order counts or sales amounts. Do not ingest every order line into the wiki.
|
||||
|
||||
```bash
|
||||
obsidian-wiki business sync kingdee --input ./kingdee-orders.json
|
||||
obsidian-wiki business query "2026年6月接了多少单"
|
||||
obsidian-wiki business query "2026-06 sales amount"
|
||||
```
|
||||
|
||||
Without `--input`, the Kingdee sync command reads `KINGDEE_API_URL` and optional `KINGDEE_API_TOKEN`, then stores the fetched JSON response in `<vault>/_meta/business-facts.sqlite`. The answer reports the statistic, counting basis, data source, and last successful sync time. If the latest successful sync is before today, the answer warns that newer data may be missing.
|
||||
|
||||
## How It Works
|
||||
|
||||
No scripts, no dependencies. The skills are markdown files that tell an AI agent *how* to operate on your Obsidian vault:
|
||||
|
||||
Reference in New Issue
Block a user