Files
ai/gateway/knowledge/README.md
Tim Olson d41fcd0499 feat: add @tag model override support and remove Qdrant dependencies
- Add model-tags parser for @Tag syntax in chat messages
- Support Anthropic models (Sonnet, Haiku, Opus) via @tag
- Remove Qdrant vector database from infrastructure and configs
- Simplify license model config to use null fallbacks
- Add greeting stream after model switch via @tag
- Fix protobuf field names to camelCase for v7 compatibility
- Add 429 rate limit retry logic with exponential backoff
- Remove RAG references from agent harness documentation
2026-04-27 20:55:18 -04:00

83 lines
2.4 KiB
Markdown

# Dexorder Knowledge Base
This directory contains global knowledge documents that are automatically loaded into the agent's context at startup.
## Structure
- **platform/**: Platform architecture and capabilities
- **trading/**: Trading concepts and fundamentals
- **indicators/**: Indicator development and usage
- **strategies/**: Strategy development and patterns
## Document Format
Documents should be in Markdown format with:
- Clear headings for chunking
- Optional YAML frontmatter for tags
- Code examples where relevant
- Cross-references to other docs
### Frontmatter Fields
`description` (required) — One or two sentences describing what the article covers. This is injected into every agent's system prompt as a KB catalog so agents know what to look up without making an extra tool call.
`tags` (optional) — List of topic tags for categorization.
### Example with Frontmatter
```markdown
---
description: "Patterns for writing custom Python indicator scripts that compute values from OHLCV data and plot live on the chart."
tags: [indicators, python, development]
---
# Custom Indicator Development
Content here...
```
## How It Works
1. At gateway startup, the DocumentLoader scans this directory
2. Each markdown file is chunked by headers (max ~1000 tokens per chunk)
3. Content hash tracking enables incremental updates
## Updating Documents
### During Development
- Edit markdown files
- Restart gateway or call reload endpoint: `POST /admin/reload-knowledge`
### In Production
- Update markdown files in git
- Deploy new version
- Gateway will detect changes and update vectors automatically
## Adding New Documents
1. Create markdown file in appropriate subdirectory
2. Use clear section headers (##, ###) for automatic chunking
3. Include practical examples and code samples
4. Add tags in frontmatter if using complex categorization
5. Restart gateway or reload knowledge
## Best Practices
- **Keep chunks focused**: Each section should cover one topic
- **Use examples**: Code samples and practical examples help
- **Link concepts**: Reference other docs for deeper dives
- **Update regularly**: Keep knowledge current with platform changes
- **Test queries**: Verify RAG retrieves relevant chunks
## Maintenance
The DocumentLoader tracks:
- Content hashes for change detection
- Number of chunks per document
- Last update timestamps
Check logs for load statistics:
```
Knowledge documents loaded: { loaded: 5, updated: 2, skipped: 3 }
```