Skip to content

Commit a01d93f

Browse files
committed
update docs
1 parent 886d2cc commit a01d93f

File tree

4 files changed

+36
-24
lines changed

4 files changed

+36
-24
lines changed

AGENTS.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@ This file documents conventions and checklists for making changes that affect th
66

77
When adding a new documentation source (e.g., a new docs site or SDK) make sure to complete all of the following steps:
88

9-
1. TypeScript ingestion (packages/ingester)
9+
1. TypeScript ingestion (ingesters)
1010

11-
- Create an ingester class extending `BaseIngester` or `MarkdownIngester` under `packages/ingester/src/ingesters/`.
12-
- Register it in `packages/ingester/src/IngesterFactory.ts`.
11+
- Create an ingester class extending `BaseIngester` or `MarkdownIngester` under `ingesters/src/ingesters/`.
12+
- Register it in `ingesters/src/IngesterFactory.ts`.
1313
- Ensure chunks carry correct metadata: `uniqueId`, `contentHash`, `sourceLink`, and `source`.
14-
- Run `pnpm generate-embeddings` (or `generate-embeddings:yes`) to populate/update the vector store.
14+
- Run the embeddings generator to populate/update the vector store:
15+
- Prefer: `bun run src/generateEmbeddings.ts` (or `bun run src/generateEmbeddings.ts -y`)
16+
- If you have scripts wired: `bun run generate-embeddings` (or `generate-embeddings:yes`)
1517

16-
2. Agents (TS)
18+
2. Agents (Python)
1719

18-
- Add the new enum value to `packages/agents/src/types/index.ts` under `DocumentSource`.
19-
- Verify Postgres vector store accepts the new `source` and filters on it (`packages/agents/src/db/postgresVectorStore.ts`).
20+
- Add the new enum value to `python/src/cairo_coder/core/types.py` under `DocumentSource`.
21+
- Ensure filtering by `metadata->>'source'` works with the new value in `python/src/cairo_coder/dspy/document_retriever.py`.
22+
- Update the query processor resource descriptions in `python/src/cairo_coder/dspy/query_processor.py` (`RESOURCE_DESCRIPTIONS`). The module validates that every `DocumentSource` has a description.
2023

2124
3. Retrieval Pipeline (Python)
2225

23-
- Add the new enum value to `python/src/cairo_coder/core/types.py` under `DocumentSource`.
24-
- Ensure filtering by `metadata->>'source'` works with the new value in `python/src/cairo_coder/dspy/document_retriever.py`.
25-
- Update the query processor resource descriptions in `python/src/cairo_coder/dspy/query_processor.py` (`RESOURCE_DESCRIPTIONS`).
26+
- No extra steps beyond the above; the retriever already supports filtering by `metadata->>'source'`.
2627

2728
4. Optimized Program Files (Python) — required
2829

@@ -34,7 +35,7 @@ When adding a new documentation source (e.g., a new docs site or SDK) make sure
3435

3536
- Ensure the new source appears where appropriate (e.g., `/v1/agents` output and documentation tables):
3637
- `API_DOCUMENTATION.md`
37-
- `packages/ingester/README.md`
38+
- `ingesters/README.md`
3839
- Any user-facing lists of supported sources
3940

4041
6. Quick Sanity Check

API_DOCUMENTATION.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,25 @@ Lists every agent registered in Cairo Coder.
5858
"openzeppelin_docs",
5959
"corelib_docs",
6060
"scarb_docs",
61-
"starknet_js"
61+
"starknet_js",
62+
"starknet_blog"
6263
]
6364
},
6465
{
65-
"id": "scarb-assistant",
66-
"name": "Scarb Assistant",
67-
"description": "Specialized assistant for Scarb build tool",
68-
"sources": ["scarb_docs"]
66+
"id": "starknet-agent",
67+
"name": "Starknet Agent",
68+
"description": "Assistant for the Starknet ecosystem (contracts, tools, docs).",
69+
"sources": [
70+
"cairo_book",
71+
"starknet_docs",
72+
"starknet_foundry",
73+
"cairo_by_example",
74+
"openzeppelin_docs",
75+
"corelib_docs",
76+
"scarb_docs",
77+
"starknet_js",
78+
"starknet_blog"
79+
]
6980
}
7081
]
7182
```
@@ -82,6 +93,7 @@ Lists every agent registered in Cairo Coder.
8293
| `corelib_docs` | Cairo core library docs |
8394
| `scarb_docs` | Scarb package manager documentation |
8495
| `starknet_js` | StarknetJS guides and SDK documentation |
96+
| `starknet_blog` | Starknet blog posts and announcements |
8597

8698
## Chat Completions
8799

ingesters/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The ingester currently supports the following documentation sources:
3232
6. **Core Library Docs** (`corelib_docs`): Cairo core library documentation
3333
7. **Scarb Docs** (`scarb_docs`): Scarb package manager documentation
3434
8. **StarknetJS Guides** (`starknet_js`): StarknetJS guides and tutorials
35+
9. **Starknet Blog** (`starknet_blog`): Starknet blog posts and announcements
3536

3637
## Architecture
3738

@@ -112,17 +113,16 @@ const chunks = splitter.splitMarkdownToChunks(markdown);
112113

113114
## Usage
114115

115-
To use the ingester package, run the `generateEmbeddings.ts` script:
116+
To use the ingester package, run the embeddings generator script:
116117

117118
```bash
118-
# From the root of the package
119-
pnpm run generate-embeddings
120-
121-
# From the root of the project
122-
turbo run generate-embeddings
119+
# Preferred (direct bun):
120+
bun run src/generateEmbeddings.ts
121+
# Non-interactive (yes to prompts):
122+
bun run src/generateEmbeddings.ts -y
123123
```
124124

125-
This will prompt you to select a documentation source to ingest. You can also select "Everything" to ingest all sources.
125+
This will prompt you to select a documentation source to ingest (or use `-y` for all). You can also select "Everything" to ingest all sources.
126126

127127
## Adding a New Documentation Source
128128

python/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ docker compose up postgres backend --build
8282
```bash
8383
curl -X POST "http://localhost:3001/v1/chat/completions" \
8484
-H "Content-Type: application/json" \
85-
-H "x-api-key: YOUR_API_KEY" \
8685
-d '{
8786
"messages": [
8887
{

0 commit comments

Comments
 (0)