[GH-ISSUE #166] skills not work #40

Closed
opened 2026-02-16 06:16:57 -05:00 by yindo · 2 comments
Owner

Originally created by @liSong5713 on GitHub (Feb 2, 2026).
Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/166

Originally assigned to: @maahir30 on GitHub.

example code


import { createDeepAgent, type FileData } from 'deepagents';
import { MemorySaver, Command } from '@langchain/langgraph';

const checkpointer = new MemorySaver();

function createFileData(content: string): FileData {
  const now = new Date().toISOString();
  return {
    content: content.split('\n'),
    created_at: now,
    modified_at: now,
  };
}

const skillsFiles: Record<string, FileData> = {};

const skillUrl = 'https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/examples/skills/langgraph-docs/SKILL.md';
const response = await fetch(skillUrl);
const skillContent = await response.text();

skillsFiles['/skills/langgraph-docs/SKILL.md'] = createFileData(skillContent);

const agent = await createDeepAgent({
  checkpointer,
  // IMPORTANT: deepagents skill source paths are virtual (POSIX) paths relative to the backend root.
  skills: ['/skills/'],
});

const config = {
  configurable: {
    thread_id: `thread-${Date.now()}`,
  },
};

let result = await agent.invoke(
  {
    messages: [
      {
        role: 'user',
        content: 'what is langraph? Use the langgraph-docs skill if available.',
      },
    ],
    files: skillsFiles,
  } as any,
  config,
);

**Troubleshoot through debug in createSkillsMiddleware **



		if ("skillsMetadata" in state && state.skillsMetadata != null) {    // should be   state.skillsMetadata.length
				loadedSkills = state.skillsMetadata;
				return;
			}

             

Originally created by @liSong5713 on GitHub (Feb 2, 2026). Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/166 Originally assigned to: @maahir30 on GitHub. example code ```typescript import { createDeepAgent, type FileData } from 'deepagents'; import { MemorySaver, Command } from '@langchain/langgraph'; const checkpointer = new MemorySaver(); function createFileData(content: string): FileData { const now = new Date().toISOString(); return { content: content.split('\n'), created_at: now, modified_at: now, }; } const skillsFiles: Record<string, FileData> = {}; const skillUrl = 'https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/examples/skills/langgraph-docs/SKILL.md'; const response = await fetch(skillUrl); const skillContent = await response.text(); skillsFiles['/skills/langgraph-docs/SKILL.md'] = createFileData(skillContent); const agent = await createDeepAgent({ checkpointer, // IMPORTANT: deepagents skill source paths are virtual (POSIX) paths relative to the backend root. skills: ['/skills/'], }); const config = { configurable: { thread_id: `thread-${Date.now()}`, }, }; let result = await agent.invoke( { messages: [ { role: 'user', content: 'what is langraph? Use the langgraph-docs skill if available.', }, ], files: skillsFiles, } as any, config, ); ``` **Troubleshoot through debug in createSkillsMiddleware ** ```typescript if ("skillsMetadata" in state && state.skillsMetadata != null) { // should be state.skillsMetadata.length loadedSkills = state.skillsMetadata; return; } ```
yindo closed this issue 2026-02-16 06:16:57 -05:00
Author
Owner

@christian-bromann commented on GitHub (Feb 2, 2026):

Thanks for raising the issue, @maahir30 is currently taking a look at that!

@christian-bromann commented on GitHub (Feb 2, 2026): Thanks for raising the issue, @maahir30 is currently taking a look at that!
Author
Owner

@maahir30 commented on GitHub (Feb 3, 2026):

#160 fixes the issue, thanks for raising!

@maahir30 commented on GitHub (Feb 3, 2026): #160 fixes the issue, thanks for raising!
yindo changed title from skills not work to [GH-ISSUE #166] skills not work 2026-06-05 17:21:08 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#40